mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-24 06:50:22 +08:00
fix: Remove null or duplicate app entries from suggest_app_for_fsentry()
This commit is contained in:
parent
c55b1e4680
commit
6900233c5a
@ -1770,7 +1770,15 @@ async function suggest_app_for_fsentry(fsentry, options){
|
|||||||
monitor.end();
|
monitor.end();
|
||||||
|
|
||||||
// return list
|
// return list
|
||||||
return suggested_apps;
|
return suggested_apps.filter((suggested_app, pos, self) => {
|
||||||
|
// Remove any null values caused by calling `get_app()` for apps that don't exist.
|
||||||
|
// This happens on self-host because we don't include `code`, among others.
|
||||||
|
if (!suggested_app)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Remove any duplicate entries
|
||||||
|
return self.indexOf(suggested_app) === pos;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_item_object(item){
|
function build_item_object(item){
|
||||||
|
Loading…
Reference in New Issue
Block a user