1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-31 04:03:51 +01:00

Fix empty window

This commit is contained in:
Nayam Amarshe 2023-09-13 18:44:46 +05:30
parent c952a330cc
commit 00ce2772db
3 changed files with 22 additions and 14 deletions

View File

@ -24,21 +24,24 @@ log.initialize({ preload: true });
sharp.cache(false);
logit("🚃 App Path: ", app.getAppPath());
app.whenReady().then(async () => {
app.on("ready", async () => {
await prepareNext("./renderer");
createMainWindow();
log.info("🚀 UPSCAYL EXEC PATH: ", execPath("realesrgan"));
log.info("🚀 MODELS PATH: ", modelsPath);
protocol.handle("file:", (request) => {
const pathname = decodeURI(request.url);
return net.fetch(pathname);
app.whenReady().then(() => {
protocol.registerFileProtocol("file", (request, callback) => {
const pathname = decodeURI(request.url.replace("file:///", ""));
callback(pathname);
});
});
createMainWindow();
if (!electronIsDev) {
autoUpdater.checkForUpdates();
}
log.info("🚀 UPSCAYL EXEC PATH: ", execPath("realesrgan"));
log.info("🚀 MODELS PATH: ", modelsPath);
});
// Quit the app once all windows are closed

View File

@ -13,8 +13,9 @@ import {
setSaveOutputFolder,
} from "./utils/config-variables";
import electronIsDev from "electron-is-dev";
import { format } from "url";
let mainWindow: BrowserWindow | null;
let mainWindow: BrowserWindow | undefined;
const createMainWindow = () => {
mainWindow = new BrowserWindow({
@ -36,10 +37,12 @@ const createMainWindow = () => {
const url = electronIsDev
? "http://localhost:8000"
: (new URL("file:///").pathname = join(
__dirname,
"../renderer/out/index.html"
)).toString();
: format({
pathname: join(__dirname, "../renderer/out/index.html"),
protocol: "file:",
slashes: true,
});
mainWindow.loadURL(url);
mainWindow.webContents.setWindowOpenHandler(({ url }) => {

View File

@ -50,7 +50,8 @@
"publish-linux-app": "tsc && npm run build && electron-builder -l --publish always",
"publish-win-app": "tsc && npm run build && electron-builder -w --publish always",
"publish-mac-universal-app": "tsc && npm run build && electron-builder --mac --universal --publish always",
"publish-mac-app": "tsc && npm run build && electron-builder --mac --x64 --publish always"
"publish-mac-app": "tsc && npm run build && electron-builder --mac --x64 --publish always",
"publish-mac-arm-app": "tsc && npm run build && electron-builder --mac --arm64 --publish always"
},
"build": {
"productName": "Upscayl",
@ -99,6 +100,7 @@
"entitlementsInherit": "resources/entitlements.mac.plist",
"notarize": false,
"gatekeeperAssess": false,
"mergeASARs": false,
"target": [
{
"target": "dmg",