feat: Add new virtual scrollbar system, resolve note context

This commit is contained in:
Jesse Wierzbinski 2024-05-11 17:42:24 -10:00
parent dd62647928
commit 6f0da44844
No known key found for this signature in database
14 changed files with 94 additions and 17 deletions

View file

@ -11,7 +11,7 @@ export const useNote = (client: MaybeRef<Mastodon | null>, noteId: string) => {
ref(client)
.value?.getStatus(noteId)
.then((res) => {
output.value = res.data;
output.value = res.data as Status;
});
return output;

View file

@ -0,0 +1,24 @@
import type { Mastodon } from "megalodon";
import type { Context } from "~/types/mastodon/context";
export const useNoteContext = (
client: MaybeRef<Mastodon | null>,
noteId: MaybeRef<string | null>,
) => {
if (!ref(client).value) {
return ref(null as Context | null);
}
const output = ref(null as Context | null);
watchEffect(() => {
if (toValue(noteId))
ref(client)
.value?.getStatusContext(toValue(noteId) ?? "")
.then((res) => {
output.value = res.data as Context;
});
});
return output;
};