Skip to content

Commit 7dc3745

Browse files
committed
fix: address review feedback for unsaved changes warning
- Simplify Visual tab guard by removing redundant activeTab check (confirmDiscardChanges already returns true when no changes exist) - Document intentional asymmetry: JSON tab button has no guard because visual tab saves changes immediately via RPC Signed-off-by: majiayu000 <1835304752@qq.com>
1 parent e812e9b commit 7dc3745

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/app/view/waveconfig/waveconfig.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const WaveConfigView = memo(({ blockId, model }: ViewComponentProps<WaveConfigVi
231231
<div className="flex gap-0 border-b border-border">
232232
<button
233233
onClick={() => {
234-
if (activeTab === "json" && !model.confirmDiscardChanges()) return;
234+
if (!model.confirmDiscardChanges()) return;
235235
setActiveTab("visual");
236236
}}
237237
className={cn(
@@ -243,6 +243,7 @@ const WaveConfigView = memo(({ blockId, model }: ViewComponentProps<WaveConfigVi
243243
>
244244
Visual
245245
</button>
246+
{/* No guard needed: visual tab saves changes immediately via RPC */}
246247
<button
247248
onClick={() => setActiveTab("json")}
248249
className={cn(

0 commit comments

Comments
 (0)