Skip to content

Commit

Permalink
fix: reset selected Product/CVE on switch to overview/back
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Junk committed Nov 30, 2023
1 parent 1213f4c commit 0d7b736
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import "boxicons/css/boxicons.min.css";
import { appStore } from "$lib/store";
import { base } from "$app/paths";
import Spinner from "$lib/Spinner.svelte";
/*global __APP_VERSION__*/
const version: string = __APP_VERSION__;
const MODE = {
Expand Down Expand Up @@ -65,6 +64,11 @@
const disable = (e: Event) => {
e.preventDefault();
};
const onSwitch = (_) => {
appStore.setSelectedCVE("");
appStore.setSelectedProduct("");
};
</script>

<svelte:window
Expand Down Expand Up @@ -92,6 +96,7 @@
<a
title={mode !== MODE.SINGLE ? "Switch to Advisory" : "Switch to Overview"}
href={switchToRoute}
on:click={onSwitch}
class="btn">{mode !== MODE.SINGLE ? "Switch to Advisory" : "Switch to Overview"}</a
>
</div>
Expand Down

0 comments on commit 0d7b736

Please sign in to comment.