@exodus/ui-config 3.13.2 → 3.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +2 -2
- package/plugin/index.js +24 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.13.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.13.2...@exodus/ui-config@3.13.3) (2026-01-29)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix: ui-config syncable atom flip flop loop (#15066)
|
|
11
|
+
|
|
6
12
|
## [3.13.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.13.1...@exodus/ui-config@3.13.2) (2026-01-13)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ui-config",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.3",
|
|
4
4
|
"description": "Helper for storing various UI-specific settings/config.",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public",
|
|
46
46
|
"provenance": false
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "a341ae86a8ffbe0f16b525344641db245429f3ca"
|
|
49
49
|
}
|
package/plugin/index.js
CHANGED
|
@@ -16,22 +16,35 @@ const createUiConfigPluginDefinition = ({ configValues }) => {
|
|
|
16
16
|
}))
|
|
17
17
|
|
|
18
18
|
const syncAtoms = () => {
|
|
19
|
-
const subscriptions =
|
|
19
|
+
const subscriptions = []
|
|
20
|
+
|
|
21
|
+
configValues
|
|
20
22
|
.filter((config) => config.syncable)
|
|
21
|
-
.
|
|
23
|
+
.forEach((config) => {
|
|
22
24
|
const localAtom = atoms[config.atomId]
|
|
23
25
|
const remoteAtom = atoms[`syncable${config.atomId}`]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (value === undefined) return
|
|
27
|
-
remoteAtom.set((prevValue) => (isEqual(value, prevValue) ? prevValue : value))
|
|
28
|
-
}),
|
|
26
|
+
// note: do not subscribe them to each other at the same time
|
|
27
|
+
// to avoid a flip flow loop. Sync local to the remote value first, then subscribe
|
|
29
28
|
|
|
29
|
+
let subscribedToLocal = false
|
|
30
|
+
subscriptions.push(
|
|
30
31
|
remoteAtom.observe((value) => {
|
|
31
|
-
if (value
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (value !== undefined) {
|
|
33
|
+
localAtom.set((prevValue) => (isEqual(value, prevValue) ? prevValue : value))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (subscribedToLocal) return
|
|
37
|
+
|
|
38
|
+
subscribedToLocal = true
|
|
39
|
+
subscriptions.push(
|
|
40
|
+
localAtom.observe((value) => {
|
|
41
|
+
if (value !== undefined) {
|
|
42
|
+
remoteAtom.set((prevValue) => (isEqual(value, prevValue) ? prevValue : value))
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
)
|
|
46
|
+
})
|
|
47
|
+
)
|
|
35
48
|
})
|
|
36
49
|
|
|
37
50
|
return () => {
|