mirror of
https://github.com/open-webui/desktop.git
synced 2026-07-09 14:57:14 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 238cce6dc8 | |||
| b255f22fe7 | |||
| d205c176ef |
+25
-4
@@ -129,8 +129,7 @@ function createWindow(show = true): void {
|
||||
{
|
||||
label: "Reset",
|
||||
click: async () => {
|
||||
await stopServerHandler();
|
||||
await resetApp();
|
||||
await resetAppHandler();
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -359,6 +358,29 @@ const stopServerHandler = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const resetAppHandler = async () => {
|
||||
try {
|
||||
await stopServerHandler(); // Stop the server if running
|
||||
SERVER_STATUS = null;
|
||||
await resetApp(); // Reset the application state
|
||||
|
||||
// Show success notification
|
||||
const notification = new Notification({
|
||||
title: "Open WebUI",
|
||||
body: "Application has been reset successfully.",
|
||||
});
|
||||
notification.show();
|
||||
} catch (error) {
|
||||
log.error("Failed to reset application:", error);
|
||||
// Show error notification
|
||||
const notification = new Notification({
|
||||
title: "Open WebUI",
|
||||
body: `Failed to reset application: ${error.message}`,
|
||||
});
|
||||
notification.show();
|
||||
}
|
||||
};
|
||||
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
if (!gotTheLock) {
|
||||
app.quit(); // Quit if another instance is already running
|
||||
@@ -496,8 +518,7 @@ if (!gotTheLock) {
|
||||
});
|
||||
|
||||
ipcMain.handle("app:reset", async (event) => {
|
||||
await stopServerHandler();
|
||||
return await resetApp();
|
||||
return await resetAppHandler();
|
||||
});
|
||||
|
||||
ipcMain.handle("get:config", async (event) => {
|
||||
|
||||
@@ -49,10 +49,12 @@
|
||||
(await window.electronAPI.getPythonStatus()) &&
|
||||
(await window.electronAPI.getPackageStatus())
|
||||
) {
|
||||
// Notify the user that the installation is complete
|
||||
// Start the server if it's not already running
|
||||
if (!(await window.electronAPI.getServerStatus())) {
|
||||
await window.electronAPI.startServer();
|
||||
}
|
||||
|
||||
// Notify the user that the installation is complete
|
||||
await window.electronAPI.notification(
|
||||
"Installation Complete",
|
||||
"Open WebUI is now ready to use."
|
||||
|
||||
Reference in New Issue
Block a user