Skip to content

Commit df8483a

Browse files
cowhenclaude
andcommitted
Fix block rename error handling and type annotation
- Move stopBlockRename() to only execute after successful RPC - Keep rename input open on error so user can retry - Add explicit type cast for followTermMenuDataAtom to fix type inference Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a28a45e commit df8483a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/app/block/blockframe-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ const HeaderTextElems = React.memo(({ viewModel, blockId, preview, error }: Head
113113
oref: WOS.makeORef("block", blockId),
114114
meta: { "frame:title": val },
115115
});
116+
stopBlockRename();
116117
} catch (error) {
117118
console.error("Failed to save block rename:", error);
118119
}
119-
stopBlockRename();
120120
},
121121
[blockId, waveEnv]
122122
);

frontend/app/view/preview/preview-model.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ export class PreviewModel implements ViewModel {
514514
this.followTermBidirAtom = atom<boolean>((get) => {
515515
return (get(this.blockAtom)?.meta?.["preview:followterm:bidir"] as boolean) ?? false;
516516
});
517-
this.followTermMenuDataAtom = atom(null);
517+
this.followTermMenuDataAtom = atom(null) as PrimitiveAtom<{ pos: any; terms: any; currentFollowId: any; bidir: any } | null>;
518518
}
519519

520520
showFollowTermMenu(e: React.MouseEvent<any>) {

0 commit comments

Comments
 (0)