fix: remove checking buf until I can figure out how to not use buf.lock

This commit is contained in:
2025-05-12 12:19:03 -04:00
parent bfc1580218
commit 95ce559ff3
107 changed files with 630 additions and 658 deletions

View File

@ -1,31 +1,31 @@
import { getContext, hasContext, setContext } from 'svelte';
type Item = {
id: string;
name: string;
}
id: string;
name: string;
};
const key = 'form';
export function setFormContext(id: string, name: string) {
const item = getFormContext();
if (!item) {
const item: Item = $state({
id,
name,
});
setContext(key, item);
const item = getFormContext();
if (!item) {
const item: Item = $state({
id,
name
});
setContext(key, item);
return;
}
return;
}
item.id = id;
item.name = name;
item.id = id;
item.name = name;
}
export function getFormContext() {
if (!hasContext(key)) {
return null;
}
if (!hasContext(key)) {
return null;
}
return getContext(key) as Item;
}
return getContext(key) as Item;
}