fix: add Tauri opener plugin for external URL handling and improve notification focus behavior

This commit is contained in:
2026-01-25 13:58:44 +11:00
parent 72ba2e200a
commit 156dfcf397
3 changed files with 69 additions and 8 deletions

View File

@@ -90,13 +90,15 @@ function InviteNotifications() {
const notify = useCallback(
(count: number) => {
const body = `You have ${count} new invitation request.`;
const invitesPath = getInboxInvitesPath();
if (isTauri()) {
sendNotification({
title: 'Invitation',
body,
path: invitesPath,
onClick: () => {
if (!window.closed) navigate(getInboxInvitesPath());
if (!window.closed) navigate(invitesPath);
},
});
} else {
@@ -108,7 +110,8 @@ function InviteNotifications() {
});
noti.onclick = () => {
if (!window.closed) navigate(getInboxInvitesPath());
window.focus();
if (!window.closed) navigate(invitesPath);
noti.close();
};
}
@@ -207,6 +210,7 @@ function MessageNotifications() {
});
noti.onclick = () => {
window.focus();
if (!window.closed) navigate(roomPath);
noti.close();
notifRef.current = undefined;