Skip to content

Commit

Permalink
Refactored default value for global setting
Browse files Browse the repository at this point in the history
  • Loading branch information
NullScope committed Jan 7, 2025
1 parent d0c7c9f commit 409f0c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Setting } from './UI';

export function LearnCategoriesSettings() {
const { t } = useTranslation();
const [learnCategories, setLearnCategories] =
const [learnCategories = 'false', setLearnCategories] =
useSyncedPref('learn-categories');
const isLearnCategoriesEnabled = String(learnCategories) !== 'false';
const isLearnCategoriesEnabled = String(learnCategories) === 'true';

return (
<Setting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export function TransactionList({
const dispatch = useDispatch();
const transactionsLatest = useRef();
const navigate = useNavigate();
const [learnCategories] = useSyncedPref('learn-categories');
const isLearnCategoriesEnabled = String(learnCategories) !== 'false';
const [learnCategories = 'false'] = useSyncedPref('learn-categories');
const isLearnCategoriesEnabled = String(learnCategories) === 'true';

useLayoutEffect(() => {
transactionsLatest.current = transactions;
Expand Down

0 comments on commit 409f0c0

Please sign in to comment.