monkey-front-core 0.0.314 → 0.0.316

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.
@@ -2455,6 +2455,7 @@ const seederReducer = (keys) => {
2455
2455
  return (reducer) => {
2456
2456
  return (state, action) => {
2457
2457
  const handledState = reducer(state, action);
2458
+ let data = handledState;
2458
2459
  if (action.type === INIT || action.type === UPDATE) {
2459
2460
  const storageValue = localStorage.getItem('mecx-store');
2460
2461
  if (storageValue) {
@@ -2469,19 +2470,19 @@ const seederReducer = (keys) => {
2469
2470
  localStorage.removeItem('mecx-store');
2470
2471
  }
2471
2472
  }
2472
- }
2473
- let data = handledState;
2474
- try {
2475
- keys.forEach((key) => {
2476
- data = {
2477
- ...data,
2478
- [key]: handledState[key]
2479
- };
2480
- });
2481
- localStorage.setItem('mecx-store', btoa(JSON.stringify(data)));
2482
- }
2483
- catch (e) {
2484
- localStorage.removeItem('mecx-store');
2473
+ data = null;
2474
+ try {
2475
+ keys.forEach((key) => {
2476
+ data = {
2477
+ ...data,
2478
+ [key]: handledState[key]
2479
+ };
2480
+ });
2481
+ localStorage.setItem('mecx-store', btoa(JSON.stringify(data)));
2482
+ }
2483
+ catch (e) {
2484
+ localStorage.removeItem('mecx-store');
2485
+ }
2485
2486
  }
2486
2487
  return data || handledState;
2487
2488
  };
@@ -3676,7 +3677,7 @@ class MonkeyEcxTokenStorageService {
3676
3677
  const handledData = {
3677
3678
  ...data
3678
3679
  };
3679
- if (data && !data?.program && config?.program) {
3680
+ if (!data?.program && config?.program) {
3680
3681
  handledData.program = config?.program?.token;
3681
3682
  }
3682
3683
  delete handledData?.me;