Fix model

This commit is contained in:
Nayam Amarshe
2024-12-20 09:07:34 +05:30
parent ed6042571f
commit d048547ba1
7 changed files with 53 additions and 9 deletions

View File

@@ -20,10 +20,10 @@ import autoUpdate from "./commands/auto-update";
import { FEATURE_FLAGS } from "../common/feature-flags";
import settings from "electron-settings";
import pasteImage from "./commands/paste-image";
import path from "path";
// INITIALIZATION
log.initialize({ preload: true });
logit("🚃 App Path: ", app.getAppPath());
app.on("ready", async () => {
await prepareNext("./renderer");
@@ -33,6 +33,14 @@ app.on("ready", async () => {
const pathname = decodeURI(request.url.replace("file:///", ""));
callback(pathname);
});
protocol.registerFileProtocol("public", (request, callback) => {
const filePath = decodeURI(request.url.replace("public:///", ""));
const asarPath = path.join(app.getAppPath(), "renderer", "out", filePath);
console.log("🚀 => asarPath:", asarPath);
callback(asarPath);
});
logit("🚃 App Path: ", app.getAppPath());
});
createMainWindow();

View File

@@ -1,4 +1,4 @@
import { BrowserWindow, shell } from "electron";
import { app, BrowserWindow, shell } from "electron";
import { getPlatform } from "./utils/get-device-specs";
import { join } from "path";
import { ELECTRON_COMMANDS } from "../common/electron-commands";
@@ -11,6 +11,8 @@ let mainWindow: BrowserWindow | undefined;
const createMainWindow = () => {
console.log("📂 DIRNAME", __dirname);
console.log("🚃 App Path: ", app.getAppPath());
mainWindow = new BrowserWindow({
icon: join(__dirname, "build", "icon.png"),
width: 1300,

View File

@@ -1,10 +1,9 @@
import { ipcRenderer, contextBridge, app } from "electron";
import { ipcRenderer, contextBridge } from "electron";
import {
getAppVersion,
getDeviceSpecs,
getPlatform,
} from "./utils/get-device-specs";
import { FEATURE_FLAGS } from "@common/feature-flags";
// 'ipcRenderer' will be available in index.js with the method 'window.electron'
contextBridge.exposeInMainWorld("electron", {