Skip to content

Commit

Permalink
Issue #PS-000 fix: Reverted zustand changes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Nov 6, 2024
1 parent 1fbdaac commit a42c7b6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/store/coursePlannerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const useCourseStore = create(
}),
{
name: 'resources',
storage: typeof window !== 'undefined' ? localStorage : undefined,
getStorage: () => localStorage
// storage: typeof window !== 'undefined' ? localStorage : undefined,
}
)
);
Expand Down
3 changes: 2 additions & 1 deletion src/store/manageUserStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const manageUserStore = create(
}),
{
name: 'fieldData',
storage: typeof window !== 'undefined' ? localStorage : undefined,
getStorage: () => localStorage
// getStorage: () => typeof window !== 'undefined' ? localStorage : undefined,
}
)
);
Expand Down
3 changes: 2 additions & 1 deletion src/store/reassignLearnerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const reassignLearnerStore = create(
}),
{
name: 'teacherApp',
storage: typeof window !== 'undefined' ? localStorage : undefined,
getStorage: () => localStorage
// storage: typeof window !== 'undefined' ? localStorage : undefined,
}
)
);
Expand Down
3 changes: 2 additions & 1 deletion src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const useStore = create(
}),
{
name: 'teacherApp',
storage: typeof window !== 'undefined' ? localStorage : undefined,
getStorage: () => localStorage
// storage: typeof window !== 'undefined' ? localStorage : undefined,
}
)
);
Expand Down
3 changes: 2 additions & 1 deletion src/store/taxonomyStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const taxonomyStore = create(
}),
{
name: 'taxonomyTeacher',
storage: typeof window !== 'undefined' ? localStorage : undefined,
getStorage: () => localStorage
// storage: typeof window !== 'undefined' ? localStorage : undefined,
}
)
);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/Helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ export const updateStoreFromCohorts = (activeCohorts: any, blockObject: any) =>
const setStateName = manageUserStore.getState().setStateName;


const district = activeCohorts[0]?.customField?.find(
const district = activeCohorts?.[0]?.customField?.find(
(item: any) => item?.label === 'DISTRICTS'
);
if (district) {
Expand All @@ -598,7 +598,7 @@ export const updateStoreFromCohorts = (activeCohorts: any, blockObject: any) =>
setDistrictName(district?.value)
}

const state = activeCohorts[0]?.customField?.find(
const state = activeCohorts?.[0]?.customField?.find(
(item: any) => item?.label === 'STATES'
);

Expand Down

0 comments on commit a42c7b6

Please sign in to comment.