Skip to content

Commit

Permalink
feat: avoid location.reload()
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Nov 27, 2024
1 parent d629530 commit 2b9be37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 1 addition & 4 deletions packages/desktop/src/sys_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,7 @@ impl SysTray {
}
Some(window) => {
window
.eval(&format!(
"location.replace('{}'); location.reload();",
route
))
.eval(&format!("location.replace('{}')", route))
.context("Failed to navigate to widget edit page.")?;

window
Expand Down
11 changes: 11 additions & 0 deletions packages/settings-ui/src/configs/WidgetConfigs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ export function WidgetConfigs() {
});
});

// Update selected config path when params change. This occurs when
// "Edit" is selected from the system tray menu.
createEffect(
on(
() => params.path,
() => {
setSelectedConfigPath(params.path ? atob(params.path) : null);
},
),
);

// Select the first config alphabetically on initial load.
createEffect(
on(
Expand Down

0 comments on commit 2b9be37

Please sign in to comment.