Skip to content

Commit b5d094c

Browse files
committed
fix: fix some patch bugs
1 parent 9719302 commit b5d094c

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

apps/frontend/src/lib/components/blocks/create-table/create-table-sheet.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
import CreateTable from "./create-table.svelte"
44
import { Button } from "$lib/components/ui/button"
55
import ScrollArea from "$lib/components/ui/scroll-area/scroll-area.svelte"
6-
import { CREATE_RLS_MODAL, CREATE_TABLE_MODAL, closeModal, isModalOpen, toggleModal } from "$lib/store/modal.store"
6+
import { CREATE_TABLE_MODAL, closeModal, isModalOpen } from "$lib/store/modal.store"
77
import { baseId, currentBase } from "$lib/store/base.store"
8-
import { QueryObserver, useIsMutating, useQueryClient } from "@tanstack/svelte-query"
8+
import { useIsMutating } from "@tanstack/svelte-query"
99
import { LoaderCircleIcon } from "lucide-svelte"
1010
1111
const isCreating = useIsMutating({ mutationKey: ["createTable"] })
1212
</script>
1313

1414
<Sheet.Root
1515
open={$isModalOpen(CREATE_TABLE_MODAL)}
16+
closeOnOutsideClick={false}
17+
closeOnEscape={false}
1618
onOpenChange={(open) => {
1719
if (!open) {
1820
closeModal(CREATE_TABLE_MODAL)
@@ -35,7 +37,7 @@
3537
</ScrollArea>
3638

3739
<Sheet.Footer>
38-
<Button variant="outline" type="button" on:click={() => closeModal(CREATE_RLS_MODAL)}>Cancel</Button>
40+
<Button variant="outline" type="button" on:click={() => closeModal(CREATE_TABLE_MODAL)}>Cancel</Button>
3941
<Button type="submit" disabled={$isCreating > 0} form="createTable">
4042
{#if $isCreating > 0}
4143
<LoaderCircleIcon class="mr-2 h-5 w-5 animate-spin" />

apps/frontend/src/lib/components/blocks/create-table/create-table.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
validators: zodClient(schema),
5454
resetForm: false,
5555
invalidateAll: true,
56-
onUpdate(event) {
56+
async onUpdate(event) {
5757
if (!event.form.valid) {
5858
console.log(event.form.errors)
5959
return
6060
}
6161
const baseId = $currentBase?.id
6262
if (!baseId) return
6363
64-
$mutation.mutate({
64+
await $mutation.mutateAsync({
6565
...event.form.data,
6666
baseId: baseId,
6767
})

apps/frontend/src/lib/components/blocks/grid-view/editable-cell/attachment-cell.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
class="group relative col-span-1 flex w-full items-center justify-center rounded-sm border"
174174
>
175175
{#if isImage(v)}
176-
<button class="h-10 w-10" on:click={() => ($selectedAttachment = v)}>
176+
<button type="button" class="h-full w-full" on:click={() => ($selectedAttachment = v)}>
177177
<img src={v.signedUrl ?? v.url} alt={v.name} />
178178
</button>
179179
{:else}
@@ -183,6 +183,7 @@
183183
<AlertDialog.Root>
184184
<AlertDialog.Trigger>
185185
<button
186+
type="button"
186187
class="absolute right-0 top-1 hidden -translate-y-1/2 translate-x-1/2 group-hover:block"
187188
>
188189
<XIcon class="text-muted-foreground h-5 w-5"></XIcon>
@@ -201,6 +202,7 @@
201202
<AlertDialog.Footer>
202203
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
203204
<AlertDialog.Action
205+
type="button"
204206
on:click={() => removeFile(i)}
205207
class="bg-red-500 text-white hover:bg-red-600">Delete</AlertDialog.Action
206208
>

0 commit comments

Comments
 (0)