Skip to content

Commit

Permalink
Better handling for undefined values in SettingsList
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Nov 20, 2024
1 parent 41a9b68 commit 995e30a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/components/settings/SettingList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function SettingList({
}, []);

const allKeys = useMemo(
() => settingsState?.settings?.map((s) => s.key),
() => settingsState?.settings?.map((s) => s.key) ?? [],
[settingsState?.settings]
);

Expand Down Expand Up @@ -131,7 +131,7 @@ export function SettingList({
<>
{editSettingModal.modal}
<Stack gap='xs'>
{(keys || allKeys).map((key, i) => {
{(keys || allKeys)?.map((key, i) => {
const setting = settingsState?.settings?.find(
(s: any) => s.key === key
);
Expand Down

0 comments on commit 995e30a

Please sign in to comment.