Skip to content

Commit 0e0718b

Browse files
cpl121brancoder
andauthored
fix: migrate funds sent to first profile (#88)
Co-authored-by: Branko Bosnic <[email protected]>
1 parent 54505c3 commit 0e0718b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/shared/lib/migration.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export const hardwareIndexes = writable<HardwareIndexes>({
123123

124124
export const migrationLog = writable<MigrationLog[]>([])
125125

126-
export const migrationAddress = writable<MigrationAddress>()
126+
export const migrationAddress = writable<MigrationAddress | null>(null)
127127

128128
export const createUnsignedBundle = (
129129
outputAddress: string,
@@ -274,7 +274,6 @@ export const generateMigrationAddress = async (ledger: boolean = false): Promise
274274
})
275275
} else {
276276
const { accounts } = get(wallet)
277-
278277
api.getMigrationAddress(false, get(accounts)[0].id, {
279278
onSuccess: (response) => {
280279
resolve(response.payload as unknown as MigrationAddress)
@@ -1345,6 +1344,7 @@ export const selectAllAddressesForMining = (): void => {
13451344
*/
13461345
export const resetMigrationState = (): void => {
13471346
const { didComplete, data, seed, bundles } = get(migration)
1347+
const { accounts } = get(wallet)
13481348
didComplete.set(false)
13491349
data.set({
13501350
lastCheckedAddressIndex: 0,
@@ -1353,6 +1353,8 @@ export const resetMigrationState = (): void => {
13531353
})
13541354
seed.set(null)
13551355
bundles.set([])
1356+
migrationAddress.set(null)
1357+
accounts.set([])
13561358
}
13571359

13581360
/**

0 commit comments

Comments
 (0)