Start Phase 4: Cleanup & Polish

This commit is contained in:
gpt-engineer-app[bot]
2025-10-21 17:32:50 +00:00
parent 00ceea51c9
commit 103a12f768
6 changed files with 534 additions and 36 deletions

View File

@@ -45,7 +45,7 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
try {
await supabase.rpc('release_expired_locks');
} catch (error: unknown) {
console.error('Error auto-releasing expired locks:', error);
// Silent failure - lock release happens periodically
}
}, 120000); // 2 minutes
@@ -83,7 +83,7 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
});
}
} catch (error: unknown) {
console.error('Error fetching queue stats:', error);
// Silent failure - stats are refreshed periodically
}
}, [user]);
@@ -165,7 +165,6 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
return false;
} catch (error: unknown) {
console.error('Error extending lock:', error);
toast({
title: 'Error',
description: getErrorMessage(error),
@@ -228,8 +227,6 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
return data;
} catch (error: unknown) {
console.error('Error releasing lock:', error);
// Always show error toasts even in silent mode
toast({
title: 'Failed to Release Lock',
@@ -274,7 +271,6 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
fetchStats();
return true;
} catch (error: unknown) {
console.error('Error escalating submission:', error);
toast({
title: 'Error',
description: getErrorMessage(error),
@@ -344,7 +340,6 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
return true;
} catch (error: unknown) {
console.error('Error claiming submission:', error);
toast({
title: 'Failed to Claim Submission',
description: getErrorMessage(error),
@@ -389,7 +384,6 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
fetchStats();
return true;
} catch (error: unknown) {
console.error('Error reassigning submission:', error);
toast({
title: 'Error',
description: getErrorMessage(error),

View File

@@ -107,8 +107,8 @@ export const useModerationStats = (options: UseModerationStatsOptions = {}) => {
flaggedContent: 0,
});
} catch (error: unknown) {
const errorMsg = getErrorMessage(error);
console.error('Error fetching moderation stats:', error);
// Silent failure - stats refresh periodically in background
// Error already captured in errorMsg for potential monitoring
} finally {
// Only clear loading if it was set
if (!silent) {