Skip to content

Commit

Permalink
Merge pull request #2125 from oasisprotocol/lw/old-comments
Browse files Browse the repository at this point in the history
Remove comments about background page (removed after mv3)
  • Loading branch information
lukaw3d authored Feb 21, 2025
2 parents a5dfb5c + b1ed736 commit 08f5418
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .changelog/2125.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove comments about background page (removed after mv3)
4 changes: 2 additions & 2 deletions playwright/tests/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.describe('The extension popup should load', () => {
await expect(page.getByRole('link', { name: /Create wallet/i })).toBeVisible()
})

test('get state from background page through webext-redux', async ({ page, extensionPopupURL }) => {
test('saga is initialized', async ({ page, extensionPopupURL }) => {
await page.goto(`${extensionPopupURL}/`)
await page.getByRole('button', { name: /Menu/i }).click()
await page.getByRole('button', { name: /Dark mode/i }).click()
Expand Down Expand Up @@ -96,7 +96,7 @@ test.describe('The extension popup should load', () => {
.getByRole('button', { name: 'Reload app' })
.click()
.catch(e => {
// Ignore error. Reloading extension's background page auto-closes its popups.
// Ignore error. Reloading extension's runtime auto-closes its popups.
expect(e.toString()).toContain('Target page, context or browser has been closed')
})
await page.close()
Expand Down
8 changes: 2 additions & 6 deletions src/app/state/persist/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,8 @@ function* resetRootState(action: ReturnType<typeof persistActions.resetRootState
const unlockedStatus = yield* select(selectUnlockedStatus)
// Redirect home to prevent infinite loading if user closes unpersisted wallet in another tab.
if (isActionSynced(action) && unlockedStatus === 'emptyUnpersisted') {
// Note: can only redirect in webapp, because saga runs in background page in extension.
// TODO: find another way if extension starts supporting multiple popups or tabs
// e.g. show "You closed wallet in another tab, click to go home"
if (runtimeIs === 'webapp') {
yield* call([window.location, window.location.assign], '/')
}
// Note: requires saga to be running in popup in extension, not in a service worker.
yield* call([window.location, window.location.assign], '/')
}
}

Expand Down

0 comments on commit 08f5418

Please sign in to comment.