From bfacfc2a4e4b50c9e0842f9f2d56de67a598b959 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 20 Nov 2024 15:44:17 -0800 Subject: [PATCH] fix: sharing notification click opening directories --- src/gui/src/UI/UIDesktop.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index a8f588949..963fff321 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -243,6 +243,18 @@ async function UIDesktop(options){ }), }); }, + click: async (notif) => { + if(notification.template === "file-shared-with-you"){ + let item_path = '/' + notification.fields?.username; + UIWindow({ + path: '/' + notification.fields?.username, + title: path.basename(item_path), + icon: await item_icon({is_dir: true, path: item_path}), + is_dir: true, + app: 'explorer', + }); + } + }, }); } }); @@ -1306,6 +1318,19 @@ async function UIDesktop(options){ } notification.icon = icon; + notification.click = async (notif) => { + if(notification.template === "file-shared-with-you"){ + let item_path = '/' + notification.fields?.username; + UIWindow({ + path: '/' + notification.fields?.username, + title: path.basename(item_path), + icon: await item_icon({is_dir: true, path: item_path}), + is_dir: true, + app: 'explorer', + }); + } + } + UINotification(notification); }) }