forked from akai/readest
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:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user