Skip to content

Commit

Permalink
Really disable DCent in FF (#1097)
Browse files Browse the repository at this point in the history
* fix: unsubscribe from login events after migrations run once

* fix: really disable the DCent account button on FF
  • Loading branch information
chidg authored Sep 29, 2023
1 parent 3e73b7c commit a7d0fe2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/extension/src/core/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Browser.runtime.onInstalled.addListener(async ({ reason, previousVersion }) => {
await migrationRunner.isComplete
} else if (reason === "update") {
// Main migrations will occur on login to ensure that password is present for any migrations that require it
passwordStore.isLoggedIn.subscribe(async (isLoggedIn) => {
const sub = passwordStore.isLoggedIn.subscribe(async (isLoggedIn) => {
if (isLoggedIn) {
const password = passwordStore.getPassword()
if (!password) return
Expand All @@ -53,7 +53,10 @@ Browser.runtime.onInstalled.addListener(async ({ reason, previousVersion }) => {
const migrationRunner = new MigrationRunner(migrations, false, {
password,
})

await migrationRunner.isComplete
// only do this once
sub.unsubscribe()
}
})
// run any legacy migrations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const ConnectAccountMethodButtons = () => {
? t("Connect your D'CENT Biometric Wallet")
: t("Not supported on this browser")
}
disabled={IS_FIREFOX}
networks={["polkadot", "ethereum"]}
to={`/accounts/add/dcent`}
/>
Expand Down

0 comments on commit a7d0fe2

Please sign in to comment.