fix: add Tauri opener plugin for external URL handling and improve notification focus behavior
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user