Skip to content

Commit 3b72e28

Browse files
committed
fix: function arguments error
fixes #194
1 parent e3deee9 commit 3b72e28

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/views/functions/EditorPanel/index.tsx

+8-11
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ export function EditorPanel({
3838
const fullName = `fn::${details.name}()`;
3939

4040
const addArgument = useStable(() => {
41-
onChange((draft: any) => {
42-
draft.arguments.push({
43-
name: '',
44-
kind: '',
45-
});
41+
onChange((draft) => {
42+
draft.args.push(["", ""]);
4643
});
4744
});
4845

@@ -196,8 +193,8 @@ export function EditorPanel({
196193
value={name}
197194
leftSection="$"
198195
placeholder="name"
199-
onChange={e => onChange((draft: any) => {
200-
draft.arguments[index][0] = e.target.value;
196+
onChange={e => onChange((draft) => {
197+
draft.args[index][0] = e.target.value;
201198
})}
202199
styles={{
203200
input: {
@@ -214,8 +211,8 @@ export function EditorPanel({
214211
variant="unstyled"
215212
value={kind}
216213
placeholder="type"
217-
onChange={value => onChange((draft: any) => {
218-
draft.arguments[index][1] = value;
214+
onChange={value => onChange((draft) => {
215+
draft.args[index][1] = value;
219216
})}
220217
styles={{
221218
input: {
@@ -227,8 +224,8 @@ export function EditorPanel({
227224
/>
228225
<ActionIcon
229226
variant="subtle"
230-
onClick={() => onChange((draft: any) => {
231-
draft.arguments.splice(index, 1);
227+
onClick={() => onChange((draft) => {
228+
draft.args.splice(index, 1);
232229
})}
233230
>
234231
<Icon path={iconDelete} />

src/views/query/TabsPane/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import classes from "./style.module.scss";
2+
import clsx from "clsx";
23
import { ActionIcon, Badge, Divider, ScrollArea, Stack, Tooltip } from "@mantine/core";
34
import { EditableText } from "~/components/EditableText";
45
import { Icon } from "~/components/Icon";
@@ -14,8 +15,6 @@ import { Entry } from "~/components/Entry";
1415
import { useContextMenu } from "mantine-contextmenu";
1516
import { TabQuery } from "~/types";
1617
import { Sortable } from "~/components/Sortable";
17-
import clsx from "clsx";
18-
import { Spacer } from "~/components/Spacer";
1918
import { useIntent } from "~/hooks/url";
2019
import { cancelLiveQueries } from "~/connection";
2120

0 commit comments

Comments
 (0)