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.
This commit is contained in:
Sylvie Crowe 2025-02-20 12:09:50 -08:00 committed by GitHub
parent b0e3b6d777
commit 27c01cfb28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1069,12 +1069,13 @@ function PreviewView({
model: PreviewModel;
}) {
const connStatus = useAtomValue(model.connStatus);
const filePath = useAtomValue(model.metaFilePath);
const [errorMsg, setErrorMsg] = useAtom(model.errorMsgAtom);
const connection = useAtomValue(model.connectionImmediate);
useEffect(() => {
setErrorMsg(null);
}, [connection]);
}, [connection, filePath]);
if (connStatus?.status != "connected") {
return null;