focus newly added card

This commit is contained in:
Triston Armstrong 2024-10-05 13:16:25 -04:00
parent 32cd89a4d1
commit 9016796b51
3 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,6 @@ export function CardSelector() {
function StickyNote() {
function _handleClick(e: MouseEvent) {
NotesSigal.default.addNote({
type: "note",
title: "New Note",

View File

@ -1,5 +1,6 @@
import { signal } from "kaioken"
import { Card } from "../types"
import { focusedItem } from "."
export type ImageCardType = Card<"image">
@ -16,6 +17,7 @@ function addImage(data: Omit<ImageCardType, "id">) {
}
images.value[newCard.id] = newCard
images.notify()
focusedItem.value = newCard.id
}
function removeImage(id: ImageCardType["id"]) {

View File

@ -1,5 +1,6 @@
import { signal } from "kaioken"
import { Card } from "../types"
import { focusedItem } from "."
export type NoteCardType = Card<"note">
@ -16,6 +17,7 @@ function addNote(data: Omit<NoteCardType, "id">) {
}
notes.value[newCard.id] = newCard
notes.notify()
focusedItem.value = newCard.id
}
function removeNote(id: NoteCardType["id"]) {