From c8b93fe33f604624981269bffd9eca0fd8f38e1f Mon Sep 17 00:00:00 2001 From: ading2210 Date: Tue, 23 Jan 2024 19:27:33 -0800 Subject: [PATCH] don't use deprecated registerFileProtocol --- src/main/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 6484d70..4a59e9c 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -6,7 +6,7 @@ import "./ipc"; -import { app, BrowserWindow, nativeTheme, protocol } from "electron"; +import { app, BrowserWindow, nativeTheme, net, protocol } from "electron"; import { checkUpdates } from "updater/main"; import { DATA_DIR } from "./constants"; @@ -64,8 +64,8 @@ function init() { registerMediaPermissionsHandler(); //register file handler so we can load the custom splash animation from the user's filesystem - protocol.registerFileProtocol("splash-animation", (request, callback) => { - callback({path: splashAnimationPath}); + protocol.handle("splash-animation", () => { + return net.fetch("file:///"+splashAnimationPath); }); bootstrap();