Agree to updated TCs

This commit is contained in:
minibits-cash
2026-07-08 16:49:02 +02:00
parent 876aa606b5
commit 273ab8e687
2 changed files with 7 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ import {NwcStoreModel} from './NwcStore'
import {AuthStoreModel} from './AuthStore'
import { log } from '../services'
export const rootStoreModelVersion = 36 // Update this if model changes require migrations defined in setupRootStore.ts
export const rootStoreModelVersion = 37 // Update this if model changes require migrations defined in setupRootStore.ts
/**
* A RootStore model.
*/

View File

@@ -240,6 +240,7 @@ export async function setupRootStore(rootStore: RootStore, opts: SetupRootStoreO
async function _runMigrations(rootStore: RootStore, restoredState: any) {
const {
transactionsStore,
userSettingsStore
} = rootStore
const currentVersion = rootStore.version
@@ -350,6 +351,11 @@ async function _runMigrations(rootStore: RootStore, restoredState: any) {
}
}
if(currentVersion < 37) {
// New onboarding and TCs agreement
userSettingsStore.setIsOnboarded(false)
}
// Set once, after all steps succeed: if any step throws, the version is
// NOT bumped and the whole migration retries on the next launch.
rootStore.setVersion(rootStoreModelVersion)