Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
f2f59d52
Unverified
Commit
f2f59d52
authored
Nov 13, 2023
by
eddie
Committed by
GitHub
Nov 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update legacy redux migration post X rollout (#7572)
parent
a5034cb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
migrations.test.ts
src/state/migrations.test.ts
+6
-1
legacy.ts
src/state/migrations/legacy.ts
+3
-3
No files found.
src/state/migrations.test.ts
View file @
f2f59d52
...
@@ -3,6 +3,7 @@ import { persistStore } from 'redux-persist'
...
@@ -3,6 +3,7 @@ import { persistStore } from 'redux-persist'
import
{
createDefaultStore
}
from
'
state
'
import
{
createDefaultStore
}
from
'
state
'
import
{
initialState
as
initialListsState
}
from
'
./lists/reducer
'
import
{
initialState
as
initialListsState
}
from
'
./lists/reducer
'
import
{
RouterPreference
}
from
'
./routing/types
'
import
{
initialState
as
initialSignaturesState
}
from
'
./signatures/reducer
'
import
{
initialState
as
initialSignaturesState
}
from
'
./signatures/reducer
'
import
{
initialState
as
initialTransactionsState
}
from
'
./transactions/reducer
'
import
{
initialState
as
initialTransactionsState
}
from
'
./transactions/reducer
'
import
{
initialState
as
initialUserState
}
from
'
./user/reducer
'
import
{
initialState
as
initialUserState
}
from
'
./user/reducer
'
...
@@ -70,7 +71,10 @@ describe('redux migrations', () => {
...
@@ -70,7 +71,10 @@ describe('redux migrations', () => {
'
redux_localstorage_simple_transactions
'
,
'
redux_localstorage_simple_transactions
'
,
JSON
.
stringify
({
1
:
{
test
:
{
info
:
'
transactions
'
}
}
})
JSON
.
stringify
({
1
:
{
test
:
{
info
:
'
transactions
'
}
}
})
)
)
localStorage
.
setItem
(
'
redux_localstorage_simple_user
'
,
JSON
.
stringify
({
test
:
'
user
'
}))
localStorage
.
setItem
(
'
redux_localstorage_simple_user
'
,
JSON
.
stringify
({
test
:
'
user
'
,
userRouterPreference
:
'
auto
'
})
)
localStorage
.
setItem
(
'
redux_localstorage_simple_lists
'
,
JSON
.
stringify
({
test
:
'
lists
'
}))
localStorage
.
setItem
(
'
redux_localstorage_simple_lists
'
,
JSON
.
stringify
({
test
:
'
lists
'
}))
localStorage
.
setItem
(
'
redux_localstorage_simple_signatures
'
,
JSON
.
stringify
({
test
:
'
signatures
'
}))
localStorage
.
setItem
(
'
redux_localstorage_simple_signatures
'
,
JSON
.
stringify
({
test
:
'
signatures
'
}))
...
@@ -97,6 +101,7 @@ describe('redux migrations', () => {
...
@@ -97,6 +101,7 @@ describe('redux migrations', () => {
},
},
user
:
{
user
:
{
test
:
'
user
'
,
test
:
'
user
'
,
userRouterPreference
:
RouterPreference
.
X
,
},
},
signatures
:
{
signatures
:
{
test
:
'
signatures
'
,
test
:
'
signatures
'
,
...
...
src/state/migrations/legacy.ts
View file @
f2f59d52
...
@@ -108,12 +108,12 @@ function legacyUserMigrations(state: any): UserState {
...
@@ -108,12 +108,12 @@ function legacyUserMigrations(state: any): UserState {
// If `userRouterPreference` is not present, reset to default
// If `userRouterPreference` is not present, reset to default
if
(
typeof
result
.
userRouterPreference
!==
'
string
'
)
{
if
(
typeof
result
.
userRouterPreference
!==
'
string
'
)
{
result
.
userRouterPreference
=
RouterPreference
.
API
result
.
userRouterPreference
=
RouterPreference
.
X
}
}
// If `userRouterPreference` is `AUTO`, migrate to `
API
`
// If `userRouterPreference` is `AUTO`, migrate to `
X
`
if
((
result
.
userRouterPreference
as
string
)
===
'
auto
'
)
{
if
((
result
.
userRouterPreference
as
string
)
===
'
auto
'
)
{
result
.
userRouterPreference
=
RouterPreference
.
API
result
.
userRouterPreference
=
RouterPreference
.
X
}
}
//If `buyFiatFlowCompleted` is present, delete it using filtering
//If `buyFiatFlowCompleted` is present, delete it using filtering
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment