don't use deprecated registerFileProtocol

This commit is contained in:
ading2210 2024-01-23 19:27:33 -08:00
parent f7da64a0ed
commit c8b93fe33f

View file

@ -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();