From 8cbc0761dbb468d7ac50ada0c66b47eae65072b1 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sat, 2 Nov 2024 11:08:16 -0400 Subject: [PATCH] add functions to access deck column state --- packages/frontend/src/ui/deck/deck-store.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/ui/deck/deck-store.ts b/packages/frontend/src/ui/deck/deck-store.ts index e87331fb3b..80f2c61f8c 100644 --- a/packages/frontend/src/ui/deck/deck-store.ts +++ b/packages/frontend/src/ui/deck/deck-store.ts @@ -4,7 +4,7 @@ */ import { throttle } from 'throttle-debounce'; -import { markRaw } from 'vue'; +import { computed, markRaw, Ref } from 'vue'; import { notificationTypes } from 'misskey-js'; import type { BasicTimelineType } from '@/timelines.js'; import { Storage } from '@/pizzax.js'; @@ -327,3 +327,13 @@ export async function updateColumn(id: Column['id'], column: Partial(id: Column['id']): TColumn { + return deckStore.state.columns.find(c => c.id === id) as TColumn; +} + +export function getReactiveColumn(id: Column['id']): Ref { + return computed(() => { + return deckStore.reactiveState.columns.value.find(c => c.id === id) as TColumn; + }); +}