Various fixes (#56)

* Add missing translation for progress synced toast

* Graceful shutdown after all books closed, closes #50

* Throttle app update check to once every day

* Avoid infinite loop to redirect to the login page, closes #54
This commit is contained in:
Huang Xin
2024-12-27 16:59:06 +01:00
committed by GitHub
parent cb2c7b5c89
commit 3dcab5a1ee
23 changed files with 73 additions and 17 deletions
+12
View File
@@ -12,3 +12,15 @@ export const tauriHandleClose = async () => {
const { getCurrentWindow } = await import('@tauri-apps/api/window');
getCurrentWindow().close();
};
export const tauriHandleOnCloseWindow = async (callback: () => void) => {
const { TauriEvent } = await import('@tauri-apps/api/event');
const { getCurrentWindow } = await import('@tauri-apps/api/window');
const { exit } = await import('@tauri-apps/plugin-process');
const currentWindow = getCurrentWindow();
return currentWindow.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async () => {
await callback();
console.log('exit app');
await exit(0);
});
};