fix(plugins): stop automatic detail retry loop

This commit is contained in:
2026-09-03 15:35:20 +08:00
parent 0bfabc0df2
commit d7058e6383
3 changed files with 189 additions and 1 deletions

View File

@@ -499,8 +499,15 @@ export function Plugins() {
}, [activeProject, workspaceHydrated]);
const selectedOfficialId = pluginIdFromKey(filters.selectedKey);
const attemptedDetailSelectionRef = useRef<string | null>(null);
useEffect(() => {
if (!selectedOfficialId || details[selectedOfficialId] || detailState[selectedOfficialId] === 'loading') return;
if (!selectedOfficialId) {
attemptedDetailSelectionRef.current = null;
return;
}
if (attemptedDetailSelectionRef.current === selectedOfficialId || details[selectedOfficialId]) return;
attemptedDetailSelectionRef.current = selectedOfficialId;
if (detailState[selectedOfficialId] === 'loading') return;
void pluginMarketplaceStore.getState().loadDetail(selectedOfficialId).catch(() => undefined);
}, [detailState, details, selectedOfficialId]);