fix(plugins): stop automatic detail retry loop
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user