update __TAURI__ api

This commit is contained in:
04041b
2024-12-13 15:37:59 -08:00
parent 7c23a39e75
commit 571920ab83
3 changed files with 12 additions and 12 deletions

View File

@@ -89,22 +89,22 @@ export const useUpdateStore = createPersistStore(
set(() => ({
remoteVersion: remoteId,
}));
if (window.__TAURI__?.notification && isApp) {
if (window.__TAURI__?.core.notification && isApp) {
// Check if notification permission is granted
await window.__TAURI__?.notification
await window.__TAURI__?.core.notification
.isPermissionGranted()
.then((granted) => {
if (!granted) {
return;
} else {
// Request permission to show notifications
window.__TAURI__?.notification
window.__TAURI__?.core.notification
.requestPermission()
.then((permission) => {
if (permission === "granted") {
if (version === remoteId) {
// Show a notification using Tauri
window.__TAURI__?.notification.sendNotification({
window.__TAURI__?.core.notification.sendNotification({
title: "NextChat",
body: `${Locale.Settings.Update.IsLatest}`,
icon: `${ChatGptIcon.src}`,
@@ -114,7 +114,7 @@ export const useUpdateStore = createPersistStore(
const updateMessage =
Locale.Settings.Update.FoundUpdate(`${remoteId}`);
// Show a notification for the new version using Tauri
window.__TAURI__?.notification.sendNotification({
window.__TAURI__?.core.notification.sendNotification({
title: "NextChat",
body: updateMessage,
icon: `${ChatGptIcon.src}`,