Skip to content

Commit 53f7906

Browse files
karooolisfrolic
andauthored
feat(explorer): indicate unsaved query changes (#3446)
Co-authored-by: Kevin Ingersoll <kingersoll@gmail.com>
1 parent 8fcf9c8 commit 53f7906

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.changeset/curly-carrots-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/explorer": patch
3+
---
4+
5+
The SQL editor now shows an indicator if the query has changed since it was last run.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function SQLEditor({ table }: Props) {
3131
query,
3232
},
3333
});
34+
const currentQuery = form.watch("query");
3435

3536
const handleSubmit = form.handleSubmit((data) => {
3637
if (validateQuery(data.query)) {
@@ -96,6 +97,12 @@ export function SQLEditor({ table }: Props) {
9697
</div>
9798
)}
9899
/>
100+
101+
{currentQuery !== query ? (
102+
<span className="absolute right-1 top-[-6px] text-5xl text-primary">
103+
<span className="text-5xl text-primary">·</span>
104+
</span>
105+
) : null}
99106
</div>
100107

101108
<div className="flex justify-end">

0 commit comments

Comments
 (0)