Skip to content

Commit

Permalink
fix: categories initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Aug 7, 2020
1 parent e5f389b commit c231964
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/store/src/state/context/categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useDocPropCount = (category: string): DocCountType => {
values.forEach(v => {
if (v !== undefined) {
if (typeof acc[v] === 'undefined') {
acc[v].count = 0;
acc[v] = { count: 0 };
}
acc[v].count = acc[v].count + 1;
}
Expand Down
2 changes: 1 addition & 1 deletion core/store/src/state/recoil/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const docPropCountState = selectorFamily<DocCountType, string>({
values.forEach(v => {
if (v !== undefined) {
if (typeof acc[v] === 'undefined') {
acc[v].count = 0;
acc[v] = { count: 0 };
}
acc[v].count = acc[v].count + 1;
}
Expand Down

0 comments on commit c231964

Please sign in to comment.