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
7a981923
Unverified
Commit
7a981923
authored
Sep 20, 2023
by
Zach Pomerantz
Committed by
GitHub
Sep 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: do not re-init active locale (#7329)
parent
9672c2db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
i18n.tsx
src/lib/i18n.tsx
+1
-0
reducer.ts
src/state/user/reducer.ts
+4
-2
No files found.
src/lib/i18n.tsx
View file @
7a981923
...
@@ -10,6 +10,7 @@ i18n.load(DEFAULT_LOCALE, DEFAULT_MESSAGES)
...
@@ -10,6 +10,7 @@ i18n.load(DEFAULT_LOCALE, DEFAULT_MESSAGES)
i18n
.
activate
(
DEFAULT_LOCALE
)
i18n
.
activate
(
DEFAULT_LOCALE
)
export
async
function
dynamicActivate
(
locale
:
SupportedLocale
)
{
export
async
function
dynamicActivate
(
locale
:
SupportedLocale
)
{
if
(
i18n
.
locale
===
locale
)
return
try
{
try
{
const
catalog
=
await
import
(
`locales/
${
locale
}
.js`
)
const
catalog
=
await
import
(
`locales/
${
locale
}
.js`
)
// Bundlers will either export it as default or as a named export named default.
// Bundlers will either export it as default or as a named export named default.
...
...
src/state/user/reducer.ts
View file @
7a981923
...
@@ -78,8 +78,10 @@ const userSlice = createSlice({
...
@@ -78,8 +78,10 @@ const userSlice = createSlice({
state
.
selectedWallet
=
wallet
state
.
selectedWallet
=
wallet
},
},
updateUserLocale
(
state
,
action
)
{
updateUserLocale
(
state
,
action
)
{
state
.
userLocale
=
action
.
payload
.
userLocale
if
(
action
.
payload
.
userLocale
!==
state
.
userLocale
)
{
state
.
timestamp
=
currentTimestamp
()
state
.
userLocale
=
action
.
payload
.
userLocale
state
.
timestamp
=
currentTimestamp
()
}
},
},
updateUserSlippageTolerance
(
state
,
action
)
{
updateUserSlippageTolerance
(
state
,
action
)
{
state
.
userSlippageTolerance
=
action
.
payload
.
userSlippageTolerance
state
.
userSlippageTolerance
=
action
.
payload
.
userSlippageTolerance
...
...
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