Skip to content

Commit fdf76f1

Browse files
committed
init when app ready
1 parent 10c0b5e commit fdf76f1

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/backend/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ import { checkG7ConnectionStatus, postPlaySessionTime } from './utils/quests'
191191
import { gameIsEpicForwarderOnHyperPlay } from './utils/shouldOpenOverlay'
192192

193193
import { createInjectedProviderWindow } from './injected_provider_window'
194+
import { init } from 'backend/services/globalProcessProxy'
194195

195196
async function initExtensionOnLaunch() {
196197
try {
@@ -694,6 +695,7 @@ if (!gotTheLock) {
694695
}
695696
}, checkGameUpdatesInterval)
696697

698+
init()
697699
return
698700
})
699701
}

src/backend/services/ExtractZipService.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { open, ZipFile, Entry } from 'yauzl'
44
import { mkdirSync, createWriteStream, rmSync, existsSync } from 'graceful-fs'
55
import { captureException } from '@sentry/electron'
66
import { join } from 'path'
7-
import './globalProcessProxy'
87

98
export interface ExtractZipProgressResponse {
109
/** Percentage of extraction progress. */

src/backend/services/globalProcessProxy.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ function isCallFromExtractZipService() {
1313
})
1414
}
1515

16-
// Create a proxy to intercept global property access
17-
globalThis.process = new Proxy(global.process, {
18-
get(target, prop, receiver) {
19-
logInfo(
20-
`XXXXXXXXXX \n \n calling global process \n \n XXXXXXXXXXXXXXXXXXXXXXXXX ', ${prop.toString()}`
21-
)
22-
if (isCallFromExtractZipService() && prop === 'noAsar') {
23-
return true
16+
export function init() {
17+
// Create a proxy to intercept global property access
18+
globalThis.process = new Proxy(global.process, {
19+
get(target, prop, receiver) {
20+
logInfo(
21+
`XXXXXXXXXX \n \n calling global process \n \n XXXXXXXXXXXXXXXXXXXXXXXXX ', ${prop.toString()}`
22+
)
23+
if (isCallFromExtractZipService() && prop === 'noAsar') {
24+
return true
25+
}
26+
return Reflect.get(target, prop, receiver)
2427
}
25-
return Reflect.get(target, prop, receiver)
26-
}
27-
})
28+
})
29+
}

0 commit comments

Comments
 (0)