mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 20:11:12 -05:00
Start Phase 4: Cleanup & Polish
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user