From b59eea47e9eacaf1c4757ea29c8f760f8f3b13cc Mon Sep 17 00:00:00 2001 From: Emily Date: Fri, 17 Jan 2025 16:44:16 +0100 Subject: [PATCH] active snapshot on creation --- dashboard/components/dialog/CreateSnapshot.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard/components/dialog/CreateSnapshot.vue b/dashboard/components/dialog/CreateSnapshot.vue index f6be51d..6bf63d8 100644 --- a/dashboard/components/dialog/CreateSnapshot.vue +++ b/dashboard/components/dialog/CreateSnapshot.vue @@ -36,7 +36,7 @@ function onColorChange() { const snapshotName = ref(""); -const { updateSnapshots } = useSnapshot(); +const { updateSnapshots, snapshot, snapshots } = useSnapshot(); const { createAlert } = useAlert() async function confirmSnapshot() { @@ -54,6 +54,9 @@ async function confirmSnapshot() { await updateSnapshots(); closeDialog(); createAlert('Snapshot created', 'Snapshot created successfully', 'far fa-circle-check', 5000); + const newSnapshot = snapshots.value.at(-1); + if (newSnapshot) snapshot.value = newSnapshot; + }