@umituz/react-native-design-system 4.26.9 → 4.26.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "4.26.
|
|
3
|
+
"version": "4.26.10",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities - TanStack persistence and expo-image-manipulator now lazy loaded",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -91,8 +91,8 @@ export const useTheme = createStore<ThemeState, ThemeActions>({
|
|
|
91
91
|
},
|
|
92
92
|
|
|
93
93
|
setThemeMode: async (mode: ThemeMode) => {
|
|
94
|
-
const { _updateInProgress } = get();
|
|
95
|
-
if (_updateInProgress) return;
|
|
94
|
+
const { _updateInProgress, themeMode: currentMode } = get();
|
|
95
|
+
if (_updateInProgress || mode === currentMode) return;
|
|
96
96
|
|
|
97
97
|
const updateId = Date.now();
|
|
98
98
|
set({ _updateInProgress: true, _lastUpdateId: updateId });
|
|
@@ -118,6 +118,9 @@ export const useTheme = createStore<ThemeState, ThemeActions>({
|
|
|
118
118
|
const { _updateInProgress, customColors: currentColors } = get();
|
|
119
119
|
if (_updateInProgress) return;
|
|
120
120
|
|
|
121
|
+
// Deep comparison to avoid redundant updates from new object references
|
|
122
|
+
if (JSON.stringify(colors) === JSON.stringify(currentColors)) return;
|
|
123
|
+
|
|
121
124
|
const updateId = Date.now();
|
|
122
125
|
set({ _updateInProgress: true, _lastUpdateId: updateId, customColors: colors });
|
|
123
126
|
|