Skip to content

Commit 680f9f7

Browse files
committed
refactor(ipc): remove unused session import and simplify options
Removed the unused `session` import and adjusted the `webPreferences` to use the `partition` directly instead of the session object.
1 parent 8a8f44f commit 680f9f7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "electron-gp",
33
"private": true,
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"type": "module",
66
"main": "dist-main/app.js",
77
"author": "traeop",

src/main/auth-social-network/ipc.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { session } from "electron";
21
import { restApi } from "../config.js";
32
import { IpcHandler, type TParamOnInit } from "@devisfuture/electron-modular";
43
import { ipcMainOn } from "../$shared/utils.js";
@@ -9,14 +8,13 @@ export class AuthSocialNetworkIpc {
98

109
onInit({ getWindow }: TParamOnInit<TWindows["authSocialNetwork"]>): void {
1110
const authSocialNetworkWindow = getWindow("window:auth-social-network");
12-
const authSession = session.fromPartition("persist:auth");
1311

1412
ipcMainOn("authSocialNetwork", async (_, { providers }) => {
1513
authSocialNetworkWindow.create({
1614
loadURL: `${restApi.urls.base}${restApi.urls.baseApi}${restApi.urls.auth.base}${restApi.urls.auth[providers]}`,
1715
options: {
1816
webPreferences: {
19-
session: authSession,
17+
partition: "persist:auth",
2018
},
2119
},
2220
});

0 commit comments

Comments
 (0)