From 010282edf299c2a39e53de7441b8850d0b8011b8 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 11 Oct 2024 14:51:52 -0400 Subject: [PATCH] fix: don't display all apps for extensionless files This hides database entries with empty types from the list of suggested apps for files that have no extension. These entries should also be removed from the database and the bug causing them should be fixed in dev center. --- src/backend/src/helpers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/src/helpers.js b/src/backend/src/helpers.js index d874bc366..c80e180f0 100644 --- a/src/backend/src/helpers.js +++ b/src/backend/src/helpers.js @@ -276,6 +276,9 @@ async function refresh_associations_cache(){ for ( const association of associations ) { let ext = association.type; if ( ext.startsWith('.') ) ext = ext.slice(1); + // Default file association entries were added with empty types; + // this prevents those from showing up. + if ( ext === '' ) continue; if ( ! lists.hasOwnProperty(ext) ) lists[ext] = []; lists[ext].push(association.app_id); }