diff --git a/src/components/moderation/ModerationQueue.tsx b/src/components/moderation/ModerationQueue.tsx index 135086f3..59afff59 100644 --- a/src/components/moderation/ModerationQueue.tsx +++ b/src/components/moderation/ModerationQueue.tsx @@ -422,12 +422,12 @@ export const ModerationQueue = forwardRef((props, ref) => { }); setSubmissionMemo(newMemoMap); - // CRM-style frozen queue logic using refs + // CRM-style frozen queue logic using admin settings const currentRefreshStrategy = refreshStrategyRef.current; const currentPreserveInteraction = preserveInteractionRef.current; if (silent) { - // Background polling: ONLY detect NEW submissions, never update existing ones + // Background polling: behavior controlled by admin settings const currentLoadedIds = loadedIdsRef.current; const newSubmissions = moderationItems.filter(item => !currentLoadedIds.has(item.id)); @@ -450,8 +450,38 @@ export const ModerationQueue = forwardRef((props, ref) => { }); } - // DON'T update items array during background polling - queue stays frozen - console.log('✅ Queue frozen - existing submissions unchanged'); + // Apply refresh strategy from admin settings + switch (currentRefreshStrategy) { + case 'notify': + // Only show notification count, never modify queue + console.log('✅ Queue frozen (notify mode) - existing submissions unchanged'); + break; + + case 'merge': + // Add new items to end of existing queue + if (newSubmissions.length > 0) { + setItems(prev => [...prev, ...newSubmissions]); + console.log('🔀 Queue merged - added', newSubmissions.length, 'new items'); + } else { + console.log('✅ Queue frozen (merge mode) - no new items to add'); + } + break; + + case 'replace': + // Full refresh: replace entire queue + setItems(moderationItems); + if (!currentPreserveInteraction) { + // Reset interaction state if not preserving + setPendingNewItems([]); + setNewItemsCount(0); + } + console.log('🔄 Queue replaced (replace mode) - full refresh with', moderationItems.length, 'items'); + break; + + default: + // Fallback to frozen behavior + console.log('✅ Queue frozen (default) - existing submissions unchanged'); + } } else { // Normal fetch: Load all items and reset pending setItems(moderationItems);