From 2d5fe7cf0ec494e890f5e2325071f45615942993 Mon Sep 17 00:00:00 2001 From: -g Date: Thu, 27 Feb 2025 16:14:39 +0800 Subject: [PATCH] update local storage in detail --- .../dirent-detail/dirent-details/file-details/collapse/index.js | 2 +- .../dirent-detail/dirent-details/file-details/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/dirent-detail/dirent-details/file-details/collapse/index.js b/frontend/src/components/dirent-detail/dirent-details/file-details/collapse/index.js index 9e8630c5f60..045bc29fb58 100644 --- a/frontend/src/components/dirent-detail/dirent-details/file-details/collapse/index.js +++ b/frontend/src/components/dirent-detail/dirent-details/file-details/collapse/index.js @@ -10,7 +10,7 @@ const Collapse = ({ className, title, children, isShow = true }) => { const toggleShowChildren = useCallback(() => { setShowChildren(!showChildren); - window.sfMetadataContext.localStorage.setItem(CAPTURE_INFO_SHOW_KEY, !showChildren); + window.localStorage.setItem(CAPTURE_INFO_SHOW_KEY, !showChildren); }, [showChildren]); return ( diff --git a/frontend/src/components/dirent-detail/dirent-details/file-details/index.js b/frontend/src/components/dirent-detail/dirent-details/file-details/index.js index ebdbb466c6c..4cd173314c0 100644 --- a/frontend/src/components/dirent-detail/dirent-details/file-details/index.js +++ b/frontend/src/components/dirent-detail/dirent-details/file-details/index.js @@ -66,7 +66,7 @@ const FileDetails = React.memo(({ repoID, dirent, path, direntDetail, isShowRepo const tagsField = useMemo(() => ({ type: CellType.SINGLE_SELECT, name: gettext('Tags') }), []); useEffect(() => { - const savedValue = window.sfMetadataContext.localStorage.getItem(CAPTURE_INFO_SHOW_KEY) || false; + const savedValue = window.localStorage.getItem(CAPTURE_INFO_SHOW_KEY) === 'true'; setCaptureInfoShow(savedValue); }, []);