@@ -97,8 +97,6 @@ export function AssetLibraryModal({ open, onClose, onPick, notify }: {
|
||||
return () => window.clearInterval(timer);
|
||||
}, [open, activeGroup, assets]);
|
||||
|
||||
if (!open) return null;
|
||||
|
||||
const createGroup = async () => {
|
||||
const name = newName.trim();
|
||||
if (!name || creatingGroup) return;
|
||||
@@ -160,6 +158,9 @@ export function AssetLibraryModal({ open, onClose, onPick, notify }: {
|
||||
}
|
||||
};
|
||||
|
||||
// 所有 Hook 必须在关闭态也保持同一调用顺序;不能在此之前提前 return。
|
||||
if (!open) return null;
|
||||
|
||||
const startRenameAsset = (item: FreeAssetItem) => {
|
||||
setConfirmDeleteAssetId(null);
|
||||
setConfirmDeleteGroupId(null);
|
||||
|
||||
Reference in New Issue
Block a user