Skip to content

Commit ecaead9

Browse files
committed
cleanup query state
1 parent 6bb88cf commit ecaead9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/explore/SQLEditor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export function SQLEditor({ table, isLiveQuery, setIsLiveQuery }: Props) {
4949
});
5050
const currentQuery = form.watch("query");
5151

52-
const handleSubmit = form.handleSubmit((data) => {
53-
if (validateQuery(data.query)) {
54-
setQuery(data.query);
52+
const handleSubmit = form.handleSubmit(({ query }) => {
53+
if (validateQuery(query)) {
54+
setQuery(query);
5555
setIsUserTriggeredRefetch(true);
5656
refetch().finally(() => setIsUserTriggeredRefetch(false));
5757
}

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/explore/TablesViewer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ export function TablesViewer({ table, isLiveQuery }: Props) {
173173
>
174174
<div className="flex w-1/2 items-center gap-4">
175175
<Input
176+
type="search"
176177
placeholder="Filter..."
177178
value={globalFilter}
178179
onChange={(event) => reactTable.setGlobalFilter(event.target.value)}
179-
className="max-w-sm rounded border px-2 py-1"
180+
className="max-w-xs rounded border px-2 py-1"
180181
disabled={!tableData}
181182
/>
182183

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/explore/consts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { editor } from "monaco-editor/esm/vs/editor/editor.api";
22

3+
export const PAGE_SIZE_OPTIONS = [5, 10, 20, 30, 40, 50, 100];
4+
35
export const monacoOptions: editor.IStandaloneEditorConstructionOptions = {
46
fontSize: 14,
57
fontWeight: "normal",
@@ -94,5 +96,3 @@ export const suggestedSQLKeywords = [
9496
"EXCEPT",
9597
] as const;
9698
export type SuggestedSQLKeyword = (typeof suggestedSQLKeywords)[number];
97-
98-
export const PAGE_SIZE_OPTIONS = [5, 10, 20, 30, 40, 50, 100];

0 commit comments

Comments
 (0)