mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 17:31:13 -05:00
Update moderation queue to reflect sorting and filtering changes
Replace smartMergeArray with a direct setItems call in useModerationQueueManager to ensure UI reflects user-initiated sorting and filtering. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ef7037e7-a631-48a2-94d1-9a4b52d7c35a Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/ef7037e7-a631-48a2-94d1-9a4b52d7c35a/OwE1IU0
This commit is contained in:
@@ -484,25 +484,10 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Manual refresh
|
// Manual refresh - ALWAYS update items for user-initiated changes (sort/filter)
|
||||||
const mergeResult = smartMergeArray(itemsRef.current, moderationItems, {
|
// Don't use smartMerge here because it won't detect order changes
|
||||||
compareFields: [
|
setItems(moderationItems);
|
||||||
"status",
|
console.log("🔄 Queue updated (manual refresh) - items:", moderationItems.length);
|
||||||
"content",
|
|
||||||
"reviewed_at",
|
|
||||||
"reviewed_by",
|
|
||||||
"reviewer_notes",
|
|
||||||
"assigned_to",
|
|
||||||
"locked_until",
|
|
||||||
],
|
|
||||||
preserveOrder: false,
|
|
||||||
addToTop: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (mergeResult.hasChanges) {
|
|
||||||
setItems(mergeResult.items);
|
|
||||||
console.log("🔄 Queue updated (manual refresh)");
|
|
||||||
}
|
|
||||||
|
|
||||||
setPendingNewItems([]);
|
setPendingNewItems([]);
|
||||||
setNewItemsCount(0);
|
setNewItemsCount(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user