From 174e2b7781e08f1fa3ff942e36754ad62903d515 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Tue, 18 Jun 2024 21:04:09 -0700 Subject: [PATCH] Take user to shared directory when clicked on share notif --- src/UI/UIDesktop.js | 13 +++++++++++++ src/icons/shared.svg | 10 ++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/UI/UIDesktop.js b/src/UI/UIDesktop.js index b8db345e..5740b49e 100644 --- a/src/UI/UIDesktop.js +++ b/src/UI/UIDesktop.js @@ -118,6 +118,7 @@ async function UIDesktop(options){ title: notification.title, text: notification.text, icon: icon, + value: notification, close: async () => { await fetch(`${window.api_origin}/notif/mark-ack`, { method: 'POST', @@ -128,6 +129,18 @@ async function UIDesktop(options){ body: JSON.stringify({ uid }), }); }, + 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 window.item_icon({is_dir: true, path: item_path}), + is_dir: true, + app: 'explorer', + }); + } + }, }); }); diff --git a/src/icons/shared.svg b/src/icons/shared.svg index 2b9f7687..200b39fb 100644 --- a/src/icons/shared.svg +++ b/src/icons/shared.svg @@ -1,3 +1,9 @@ - - + + shared-svg + + + + \ No newline at end of file