Remove (kindof) unused reloadWindow IPC
We now bundle the renderer code within the app. So a load-fail indicates something really wrong, not something we can deal with upfront (the code wasn't probably even working - e.g. it was assigning to a function parameter mainWindow, not the actual global var behind it).
This commit is contained in:
parent
3a6c7b2dcd
commit
b3289f2b8d
|
@ -1,30 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>ente Photos</title>
|
||||
</head>
|
||||
|
||||
<body style="background-color: black">
|
||||
<div
|
||||
style="
|
||||
height: 95vh;
|
||||
width: 96vw;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: white;
|
||||
"
|
||||
>
|
||||
<div>
|
||||
<div style="margin-bottom: 10px">
|
||||
Site unreachable, please try again later
|
||||
</div>
|
||||
<button onClick="window[`ElectronAPIs`].reloadWindow()">
|
||||
Reload
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +1,6 @@
|
|||
import { ipcRenderer } from "electron";
|
||||
import { AppUpdateInfo } from "../types";
|
||||
|
||||
export const reloadWindow = () => {
|
||||
ipcRenderer.send("reload-window");
|
||||
};
|
||||
|
||||
export const registerUpdateEventListener = (
|
||||
showUpdateDialog: (updateInfo: AppUpdateInfo) => void,
|
||||
) => {
|
||||
|
|
|
@ -55,7 +55,6 @@ import {
|
|||
muteUpdateNotification,
|
||||
registerForegroundEventListener,
|
||||
registerUpdateEventListener,
|
||||
reloadWindow,
|
||||
skipAppUpdate,
|
||||
updateAndRestart,
|
||||
} from "./api/system";
|
||||
|
@ -327,7 +326,6 @@ contextBridge.exposeInMainWorld("ElectronAPIs", {
|
|||
saveFileToDisk,
|
||||
selectDirectory,
|
||||
clearElectronStore,
|
||||
reloadWindow,
|
||||
readTextFile,
|
||||
showUploadFilesDialog,
|
||||
showUploadDirsDialog,
|
||||
|
|
|
@ -52,16 +52,6 @@ export const createWindow = async () => {
|
|||
);
|
||||
mainWindow.loadURL(rendererURL);
|
||||
}
|
||||
mainWindow.webContents.on("did-fail-load", () => {
|
||||
splash.close();
|
||||
isDev
|
||||
? mainWindow.loadFile(`../resources/error.html`)
|
||||
: splash.loadURL(
|
||||
`file://${path.join(process.resourcesPath, "error.html")}`,
|
||||
);
|
||||
mainWindow.maximize();
|
||||
mainWindow.show();
|
||||
});
|
||||
mainWindow.once("ready-to-show", async () => {
|
||||
try {
|
||||
splash.destroy();
|
||||
|
|
|
@ -26,7 +26,6 @@ import {
|
|||
generateImageThumbnail,
|
||||
} from "../services/imageProcessor";
|
||||
import { logErrorSentry } from "../services/sentry";
|
||||
import { createWindow } from "./createWindow";
|
||||
import { generateTempFilePath } from "./temp";
|
||||
|
||||
export default function setupIpcComs(
|
||||
|
@ -43,12 +42,6 @@ export default function setupIpcComs(
|
|||
}
|
||||
});
|
||||
|
||||
ipcMain.on("reload-window", async () => {
|
||||
const secondWindow = await createWindow();
|
||||
mainWindow.destroy();
|
||||
mainWindow = secondWindow;
|
||||
});
|
||||
|
||||
ipcMain.handle("show-upload-files-dialog", async () => {
|
||||
const files = await dialog.showOpenDialog({
|
||||
properties: ["openFile", "multiSelections"],
|
||||
|
|
Loading…
Reference in a new issue