Skip to content

Commit 27c01cf

Browse files
authored
fix: dismiss the error when changing path
The error overlay used to persist even after the path was changed. This changes this behavior so it is automatically dismissed when changing the path.
1 parent b0e3b6d commit 27c01cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/app/view/preview/preview.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,12 +1069,13 @@ function PreviewView({
10691069
model: PreviewModel;
10701070
}) {
10711071
const connStatus = useAtomValue(model.connStatus);
1072+
const filePath = useAtomValue(model.metaFilePath);
10721073
const [errorMsg, setErrorMsg] = useAtom(model.errorMsgAtom);
10731074
const connection = useAtomValue(model.connectionImmediate);
10741075

10751076
useEffect(() => {
10761077
setErrorMsg(null);
1077-
}, [connection]);
1078+
}, [connection, filePath]);
10781079

10791080
if (connStatus?.status != "connected") {
10801081
return null;

0 commit comments

Comments
 (0)