1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

fix: toggle metadata file

This commit is contained in:
杨国璇
2025-02-28 17:52:37 +08:00
parent 7cda15e19c
commit 36dd38ffa0

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import React, { useCallback, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import ResizeBar from '../../../resize-bar';
@@ -7,7 +7,8 @@ import { DRAG_HANDLER_HEIGHT } from '../../../resize-bar/constants';
import './index.css';
const Detail = ({ children, className }) => {
const [width, setWidth] = useState(300);
const lastSettingsValue = localStorage.getItem('sf_cur_view_detail_width');
const [width, setWidth] = useState(lastSettingsValue ? parseInt(lastSettingsValue) : 300);
const [isResizing, setResizing] = useState(false);
const resizeBarRef = useRef(null);
const dragHandlerRef = useRef(null);
@@ -42,12 +43,6 @@ const Detail = ({ children, className }) => {
setDragHandlerTop(dragHandlerRefTop);
}, [setDragHandlerTop]);
useEffect(() => {
const lastSettingsValue = localStorage.getItem('sf_cur_view_detail_width');
const width = lastSettingsValue ? parseInt(lastSettingsValue) : 300;
setWidth(width);
}, []);
return (
<div
className={classnames('cur-view-detail', className, {