mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
replaced nullable state with derived
This commit is contained in:
+1
-8
@@ -15,11 +15,6 @@
|
||||
|
||||
let { label, value = $bindable(), limited = false, column }: Props = $props();
|
||||
|
||||
let nullable = $state(false);
|
||||
$effect(() => {
|
||||
nullable = !limited ? !column.required : false;
|
||||
});
|
||||
|
||||
const defaultData = getDefaultSpatialData('linestring') as number[][];
|
||||
function onAddPoint() {
|
||||
value = [...(value || defaultData), getDefaultSpatialData('point') as number[]];
|
||||
@@ -39,9 +34,7 @@
|
||||
value = getDefaultSpatialData('linestring') as number[][];
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
nullable = !limited ? !column.required : false;
|
||||
});
|
||||
const nullable = $derived(!limited ? !column.required : false);
|
||||
</script>
|
||||
|
||||
<Layout.Stack>
|
||||
|
||||
+1
-5
@@ -15,8 +15,6 @@
|
||||
|
||||
let { label, value = $bindable(), limited = false, column }: Props = $props();
|
||||
|
||||
let nullable = $state(false);
|
||||
|
||||
function handlePointChange(index: number, newValue: number) {
|
||||
if (value) {
|
||||
value[index] = newValue;
|
||||
@@ -27,9 +25,7 @@
|
||||
value = getDefaultSpatialData('point') as number[];
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
nullable = !limited ? !column.required : false;
|
||||
});
|
||||
const nullable = $derived(!limited ? !column.required : false);
|
||||
</script>
|
||||
|
||||
<Layout.Stack>
|
||||
|
||||
+1
-5
@@ -15,8 +15,6 @@
|
||||
|
||||
let { label, value = $bindable(), limited = false, column }: Props = $props();
|
||||
|
||||
let nullable = $state(false);
|
||||
|
||||
function pushCoordinate(ringIndex: number) {
|
||||
const ring = value[ringIndex];
|
||||
if (!ring) return;
|
||||
@@ -59,9 +57,7 @@
|
||||
value = getDefaultSpatialData('polygon') as number[][][];
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
nullable = !limited ? !column.required : false;
|
||||
});
|
||||
const nullable = $derived(!limited ? !column.required : false);
|
||||
</script>
|
||||
|
||||
<Layout.Stack>
|
||||
|
||||
Reference in New Issue
Block a user