mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-24 12:58:34 +00:00
fix(wiki title): resolve name change (#7863)
This commit is contained in:
@@ -48,6 +48,7 @@ const PageItem = ({
|
|||||||
const [isMouseEntered, setIsMouseEntered] = useState(false);
|
const [isMouseEntered, setIsMouseEntered] = useState(false);
|
||||||
|
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
const toggleTriggeredRef = useRef(false);
|
||||||
|
|
||||||
const [, drag] = useDrag(() => ({
|
const [, drag] = useDrag(() => ({
|
||||||
type: 'wiki-page',
|
type: 'wiki-page',
|
||||||
@@ -140,6 +141,7 @@ const PageItem = ({
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
setIsShowNameEditor(!isShowNameEditor);
|
setIsShowNameEditor(!isShowNameEditor);
|
||||||
|
toggleTriggeredRef.current = true;
|
||||||
}, [isShowNameEditor]);
|
}, [isShowNameEditor]);
|
||||||
|
|
||||||
const changeItemFreeze = (isFreeze) => {
|
const changeItemFreeze = (isFreeze) => {
|
||||||
@@ -197,8 +199,9 @@ const PageItem = ({
|
|||||||
}, [updateSelected]);
|
}, [updateSelected]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isShowNameEditor) {
|
if (!isShowNameEditor && toggleTriggeredRef.current) {
|
||||||
savePageProperties();
|
savePageProperties();
|
||||||
|
toggleTriggeredRef.current = false;
|
||||||
}
|
}
|
||||||
}, [isShowNameEditor, savePageProperties]);
|
}, [isShowNameEditor, savePageProperties]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user