mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 08:48:28 +00:00
add a key to specializedviewcomponent so that we don't get stale content displayed (#1981)
This commit is contained in:
parent
3c75d1314c
commit
1929c70e04
1 changed files with 2 additions and 1 deletions
|
|
@ -1075,6 +1075,7 @@ const SpecializedView = memo(({ parentRef, model }: SpecializedViewProps) => {
|
|||
const specializedView = useAtomValue(model.specializedView);
|
||||
const mimeType = useAtomValue(model.fileMimeType);
|
||||
const setCanPreview = useSetAtom(model.canPreview);
|
||||
const path = useAtomValue(model.statFilePath);
|
||||
|
||||
useEffect(() => {
|
||||
setCanPreview(canPreview(mimeType));
|
||||
|
|
@ -1087,7 +1088,7 @@ const SpecializedView = memo(({ parentRef, model }: SpecializedViewProps) => {
|
|||
if (!SpecializedViewComponent) {
|
||||
return <CenteredDiv>Invalid Specialzied View Component ({specializedView.specializedView})</CenteredDiv>;
|
||||
}
|
||||
return <SpecializedViewComponent model={model} parentRef={parentRef} />;
|
||||
return <SpecializedViewComponent key={path} model={model} parentRef={parentRef} />;
|
||||
});
|
||||
|
||||
const fetchSuggestions = async (
|
||||
|
|
|
|||
Loading…
Reference in a new issue