@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.
Files changed (2) hide show
  1. package/dist/index.js +8 -0
  2. 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(',');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "0.0.78",
3
+ "version": "0.0.79",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {