@sonic-equipment/ui 0.0.78 → 0.0.79
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/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -359,6 +359,14 @@ function useFeatureFlags() {
|
|
|
359
359
|
return useMemo(() => {
|
|
360
360
|
const queryParams = qs.parse(search);
|
|
361
361
|
const showNewPageQueryValue = String(queryParams['new']).toLowerCase() === 'true';
|
|
362
|
+
const hasQueryStringFeatures = Boolean(queryParams['features']);
|
|
363
|
+
if (!showNewPageQueryValue && !hasQueryStringFeatures) {
|
|
364
|
+
/* When no new feature flags are set get them from localStorage */
|
|
365
|
+
return Object.entries(features).reduce((acc, [, value]) => ({
|
|
366
|
+
...acc,
|
|
367
|
+
[value]: localStorage.getItem(value) === 'true',
|
|
368
|
+
}), {});
|
|
369
|
+
}
|
|
362
370
|
const queryStringFeatures = String(queryParams['features'])
|
|
363
371
|
.toLowerCase()
|
|
364
372
|
.split(',');
|