Skip to content

Commit

Permalink
fix: fix duplicate table bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Aug 16, 2024
1 parent 53efb9a commit 1d15a68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@
>
Cancel
</Button>
<Form.Button
disabled={$duplicateBaseMutation.isPending}
on:click={() => {
$duplicateBaseMutation.mutate({ id: base.id })
}}
>
<Form.Button disabled={$duplicateBaseMutation.isPending}>
{#if $duplicateBaseMutation.isPending}
<LoaderCircleIcon class="mr-2 h-5 w-5 animate-spin" />
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
import { Input } from "$lib/components/ui/input"
import { Checkbox } from "$lib/components/ui/checkbox"
import * as Alert from "$lib/components/ui/alert"
import { getTable } from "$lib/store/table.store"
export let table: TableDo
const table = getTable()
const form = superForm(
defaults(
{
tableId: table.id.value,
tableId: $table.id.value,
name: "",
includeData: true,
},
Expand Down Expand Up @@ -68,9 +69,9 @@
>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Duplicate Table {table.name.value}</Dialog.Title>
<Dialog.Title>Duplicate Table {$table.name.value}</Dialog.Title>
<Dialog.Description>
Create a new table with the same structure as {table.name.value}
Create a new table with the same structure as {$table.name.value}
</Dialog.Description>
</Dialog.Header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,4 @@
</div>
</header>

<DuplicateTable table={$table} />
<DuplicateTable />

0 comments on commit 1d15a68

Please sign in to comment.