Remove header.
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
import log from "electron-log/main";
|
||||
import { autoUpdater } from "electron-updater";
|
||||
import path, { join } from "path";
|
||||
import appIcon from "../../resources/diamond.png?asset";
|
||||
import appIcon from "../../resources/icon.png?asset";
|
||||
import {
|
||||
default as ErrorTypeCheck,
|
||||
default as errorTypeCheck,
|
||||
@@ -29,7 +29,8 @@ Sentry.init({
|
||||
});
|
||||
|
||||
log.initialize();
|
||||
const isMac = process.platform === "darwin";
|
||||
const isMac: boolean = process.platform === "darwin";
|
||||
const protocol: string = "shopprt";
|
||||
let isAppQuitting = false; //Needed on Mac as an override to allow us to fully quit the app.
|
||||
// Initialize the server
|
||||
const localServer = new LocalServer();
|
||||
@@ -311,7 +312,7 @@ if (!gotTheLock) {
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(async () => {
|
||||
// Set app user model id for windows
|
||||
electronApp.setAppUserModelId("com.electron");
|
||||
electronApp.setAppUserModelId("com.convenient-brands.partner");
|
||||
|
||||
// Default open or close DevTools by F12 in development
|
||||
// and ignore CommandOrControl + R in production.
|
||||
@@ -320,10 +321,22 @@ app.whenReady().then(async () => {
|
||||
optimizer.watchWindowShortcuts(window);
|
||||
});
|
||||
|
||||
const isDefaultProtocolClient = app.setAsDefaultProtocolClient(protocol);
|
||||
if (isDefaultProtocolClient) {
|
||||
log.info("Protocol handler registered successfully.");
|
||||
} else {
|
||||
log.warn("Failed to register protocol handler.");
|
||||
}
|
||||
|
||||
// Add this event handler for second instance
|
||||
app.on("second-instance", () => {
|
||||
app.on("second-instance", (_event: Electron.Event, argv: string[]) => {
|
||||
// Someone tried to run a second instance, we should focus our window
|
||||
openMainWindow();
|
||||
const url = argv.find((arg) => arg.startsWith(`${protocol}://`));
|
||||
if (url) {
|
||||
console.log("App launched with URL:", url);
|
||||
// Handle the URL. Not doing anything for now.
|
||||
}
|
||||
});
|
||||
|
||||
//Dynamically load ipcMain handlers once ready.
|
||||
@@ -406,6 +419,16 @@ app.whenReady().then(async () => {
|
||||
});
|
||||
});
|
||||
|
||||
app.on(
|
||||
"open-url",
|
||||
(
|
||||
event: Electron.Event, //, _url: string
|
||||
) => {
|
||||
event.preventDefault();
|
||||
//Don't do anythign for now. We just want to open the app.
|
||||
},
|
||||
);
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
|
||||
Reference in New Issue
Block a user