Skip to content

Commit

Permalink
[Fix] MetaMask stuck loading after app update (#1212)
Browse files Browse the repository at this point in the history
* fixes

* bump ext importer

* fixes

* add call-bind-apply-helpers as a dep

* add debug logs

* refactors and fixes

* rm debug logs

* bump 0.23.0

* rm more debug logs

* rm debug log
  • Loading branch information
BrettCleary authored Jan 29, 2025
1 parent 4941e7f commit 13efb50
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 14 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperplay",
"version": "0.22.6",
"version": "0.23.0",
"private": true,
"main": "build/main/main.js",
"homepage": "./",
Expand Down Expand Up @@ -95,6 +95,7 @@
"auto-launch": "^5.0.6",
"axios": "^1.7.5",
"bn.js": "^5.2.1",
"call-bind-apply-helpers": "^1.0.1",
"classic-level": "^1.4.1",
"classnames": "^2.5.1",
"compare-versions": "^6.1.1",
Expand Down Expand Up @@ -225,7 +226,7 @@
"vite-plugin-svgr": "^2.2.2"
},
"optionalDependencies": {
"@hyperplay/extension-importer": "^0.1.1-alpha.0",
"@hyperplay/extension-importer": "^0.3.0",
"@hyperplay/extension-provider": "^0.0.9",
"@hyperplay/mock-backend": "^0.0.1",
"@hyperplay/overlay": "^0.0.7",
Expand Down
13 changes: 8 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/extensions/MetaMask_v10.22.2/background-3.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/extensions/MetaMask_v10.22.2/common-0.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/extensions/MetaMask_v10.22.2/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}
],
"default_locale": "en",
"description": "other build from git id: 0f96e8e3",
"description": "other build from git id: f5c002c3",
"host_permissions": [
"http://localhost:8545/",
"file://*/*",
Expand Down
2 changes: 1 addition & 1 deletion public/extensions/MetaMask_v10.22.2/scripts/app-init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/extensions/MetaMask_v10.22.2/scripts/inpage.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/extensions/MetaMask_v10.22.2/ui-12.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ import { checkG7ConnectionStatus, postPlaySessionTime } from './utils/quests'

import { gameIsEpicForwarderOnHyperPlay } from './utils/shouldOpenOverlay'

async function initExtensionOnLaunch() {
try {
const extImporter = await import('@hyperplay/extension-importer')
await extImporter.initExtensionBeforeWindowCreation(hpApi)
} catch (err) {
logError(
`Error initializing extension on launch ${err}`,
LogPrefix.HyperPlay
)
}
}

initExtensionOnLaunch()

async function startProxyServer() {
try {
const proxyServer = await import('@hyperplay/proxy-server')
Expand Down Expand Up @@ -681,6 +695,8 @@ ipcMain.once('loadingScreenReady', () => {
ipcMain.once('frontendReady', async () => {
logInfo('Frontend Ready', LogPrefix.Backend)
await initExtension(hpApi)
// wait for mm SW to initialize
await wait(5000)
ipcMain.emit('reloadApp')
handleProtocol([openUrlArgument, ...process.argv])
setTimeout(() => {
Expand Down

0 comments on commit 13efb50

Please sign in to comment.