mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-18 08:16:07 +00:00
update local storage in detail (#7529)
Co-authored-by: -g <aries@Mac.local>
This commit is contained in:
@@ -10,7 +10,7 @@ const Collapse = ({ className, title, children, isShow = true }) => {
|
|||||||
|
|
||||||
const toggleShowChildren = useCallback(() => {
|
const toggleShowChildren = useCallback(() => {
|
||||||
setShowChildren(!showChildren);
|
setShowChildren(!showChildren);
|
||||||
window.sfMetadataContext.localStorage.setItem(CAPTURE_INFO_SHOW_KEY, !showChildren);
|
window.localStorage.setItem(CAPTURE_INFO_SHOW_KEY, !showChildren);
|
||||||
}, [showChildren]);
|
}, [showChildren]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@@ -66,7 +66,7 @@ const FileDetails = React.memo(({ repoID, dirent, path, direntDetail, isShowRepo
|
|||||||
const tagsField = useMemo(() => ({ type: CellType.SINGLE_SELECT, name: gettext('Tags') }), []);
|
const tagsField = useMemo(() => ({ type: CellType.SINGLE_SELECT, name: gettext('Tags') }), []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const savedValue = window.sfMetadataContext.localStorage.getItem(CAPTURE_INFO_SHOW_KEY) || false;
|
const savedValue = window.localStorage.getItem(CAPTURE_INFO_SHOW_KEY) === 'true';
|
||||||
setCaptureInfoShow(savedValue);
|
setCaptureInfoShow(savedValue);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user