Skip to content

Commit

Permalink
Merge branch 'main' into restore-from-backup
Browse files Browse the repository at this point in the history
  • Loading branch information
moonsettler authored Apr 25, 2023
2 parents 1d10e3e + df10e27 commit 23686d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/pages/WalletPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,9 @@ export default {
this.walletURL = this.baseURL;
}
let activeMintUrl = localStorage.getItem("cashu.activeMintUrl");
await this.activateMint(activeMintUrl);
// we'll force the activation of the mint for the migration
// from without a pinia store
await this.activateMint(activeMintUrl, false, true);
} else {
this.setTab("settings");
}
Expand Down Expand Up @@ -2434,13 +2436,13 @@ export default {
);
// startup tasks
this.checkProofsSpendable(this.activeProofs, true).catch((err) => {
await this.checkProofsSpendable(this.activeProofs, true).catch((err) => {
return;
});
this.checkPendingInvoices().catch((err) => {
await this.checkPendingInvoices().catch((err) => {
return;
});
this.checkPendingTokens().catch((err) => {
await this.checkPendingTokens().catch((err) => {
return;
});
Expand Down
7 changes: 5 additions & 2 deletions src/stores/mints.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ export const useMintsStore = defineStore("mints", {
this.showAddMintDialog = false;
}
},
activateMint: async function (url, verbose = false) {
activateMint: async function (url, verbose = false, force = false) {
const workers = useWorkersStore();
if (url === this.activeMintUrl) {
if (url === this.activeMintUrl && !force) {
// return here because this function is called repeatedly by the
// invoice check and token spendable check workers and would otherwise
// run until cleaAllWorkers and kill the woerkers
return;
}
// we need to stop workers because they will reset the activeMint again
Expand Down

0 comments on commit 23686d8

Please sign in to comment.