active snapshot on creation

This commit is contained in:
Emily
2025-01-17 16:44:16 +01:00
parent 473331047d
commit b59eea47e9

View File

@@ -36,7 +36,7 @@ function onColorChange() {
const snapshotName = ref<string>("");
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;
}
</script>