-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
063deb5
commit 1599975
Showing
5 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/shared/src/lib/core/profile/constants/profile-version.constant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { AppStage } from '@core/app/enums' | ||
|
||
export const PROFILE_VERSION: Record<AppStage, number> = { | ||
[AppStage.ALPHA]: 22, | ||
[AppStage.ALPHA]: 23, | ||
[AppStage.BETA]: 1, | ||
[AppStage.PROD]: 12, | ||
[AppStage.PROD]: 13, | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/shared/src/lib/core/profile/migrations/alpha/alpha-profile-migration-22-to-23.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { CryptoCurrency, FiatCurrency } from '@core/market' | ||
import { IPersistedProfile } from '@core/profile/interfaces' | ||
|
||
export function alphaProfileMigration22To23(existingProfile: unknown): Promise<void> { | ||
const profile = existingProfile as IPersistedProfile | ||
const marketCurrencies = [...Object.values(FiatCurrency), ...Object.values(CryptoCurrency)] | ||
|
||
if (!marketCurrencies.includes(profile?.settings?.marketCurrency)) { | ||
profile.settings.marketCurrency = FiatCurrency.USD | ||
} | ||
|
||
return Promise.resolve() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/shared/src/lib/core/profile/migrations/prod/prod-profile-migration-12-to-13.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { CryptoCurrency, FiatCurrency } from '@core/market' | ||
import { IPersistedProfile } from '@core/profile/interfaces' | ||
|
||
export function prodProfileMigration12To13(existingProfile: unknown): Promise<void> { | ||
const profile = existingProfile as IPersistedProfile | ||
const marketCurrencies = [...Object.values(FiatCurrency), ...Object.values(CryptoCurrency)] | ||
|
||
if (!marketCurrencies.includes(profile?.settings?.marketCurrency)) { | ||
profile.settings.marketCurrency = FiatCurrency.USD | ||
} | ||
|
||
return Promise.resolve() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters