Skip to content

Commit 11fc7ba

Browse files
perryd01Miklos Daniel
authored andcommitted
refactor: profileSettingsPopover with state ref
1 parent ab6a9f8 commit 11fc7ba

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/App.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
let dialogTextArea = $state();
4444
let dialogDatePicker = $state();
4545
let themeSettingsPopover = $state<Popover | null>(null);
46-
let profileSettingsPopover = $state();
46+
let profileSettingsPopover = $state<Popover | null>(null);
4747
4848
// Create ToDo Fields
4949
let itemInputValue;
@@ -71,8 +71,10 @@
7171
};
7272
7373
const handleProfileClick = (event) => {
74-
profileSettingsPopover.opener = event.detail.targetRef;
75-
profileSettingsPopover.open = true;
74+
if (profileSettingsPopover) {
75+
profileSettingsPopover.opener = event.detail.targetRef;
76+
profileSettingsPopover.open = !profileSettingsPopover.open;
77+
}
7678
};
7779
7880
const handleProfileSettingsSelect = (event) => {

0 commit comments

Comments
 (0)