Take user to shared directory when clicked on share notif

This commit is contained in:
Nariman Jelveh 2024-06-18 21:04:09 -07:00
parent cd65217f5c
commit 174e2b7781
2 changed files with 21 additions and 2 deletions

View File

@ -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',
});
}
},
});
});

View File

@ -1,3 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-people-fill" viewBox="0 0 16 16">
<path d="M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"/>
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
<title>shared-svg</title>
<style>
.s0 { fill: #4e5158 }
</style>
<g id="Layer 1">
<path id="Layer" class="s0" d="m7 14c0 0-1 0-1-1 0-1 1-4 5-4 4 0 5 3 5 4 0 1-1 1-1 1zm4-6c0.8 0 1.6-0.3 2.1-0.9 0.6-0.5 0.9-1.3 0.9-2.1 0-0.8-0.3-1.6-0.9-2.1-0.5-0.6-1.3-0.9-2.1-0.9-0.8 0-1.6 0.3-2.1 0.9-0.6 0.5-0.9 1.3-0.9 2.1 0 0.8 0.3 1.6 0.9 2.1 0.5 0.6 1.3 0.9 2.1 0.9zm-5.8 6q0-0.1-0.1-0.2 0-0.2 0-0.3-0.1-0.1-0.1-0.2 0-0.2 0-0.3c0-1.4 0.7-2.8 1.9-3.7q-0.2-0.1-0.4-0.1-0.3-0.1-0.5-0.1-0.3-0.1-0.5-0.1-0.3 0-0.5 0c-4 0-5 3-5 4 0 1 1 1 1 1zm-0.7-6c0.6 0 1.3-0.3 1.8-0.7 0.4-0.5 0.7-1.1 0.7-1.8 0-0.7-0.3-1.3-0.7-1.8-0.5-0.4-1.2-0.7-1.8-0.7-0.7 0-1.3 0.3-1.8 0.7-0.5 0.5-0.7 1.1-0.7 1.8 0 0.7 0.2 1.3 0.7 1.8 0.5 0.4 1.1 0.7 1.8 0.7z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 361 B

After

Width:  |  Height:  |  Size: 841 B