mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 18:51:12 -05:00
Fix admin dashboard auto-refresh
This commit is contained in:
@@ -126,6 +126,30 @@ export function useAdminSettings() {
|
||||
return parseInt(value?.toString() || '30') * 1000; // Convert to milliseconds
|
||||
};
|
||||
|
||||
/**
|
||||
* Get auto-refresh strategy setting
|
||||
* Returns: 'merge' | 'replace' | 'notify'
|
||||
*/
|
||||
const getAutoRefreshStrategy = (): 'merge' | 'replace' | 'notify' => {
|
||||
const value = getSettingValue('auto_refresh_strategy', 'merge');
|
||||
const cleanValue = typeof value === 'string' ? value.replace(/"/g, '') : value;
|
||||
return cleanValue as 'merge' | 'replace' | 'notify';
|
||||
};
|
||||
|
||||
/**
|
||||
* Get preserve interaction state setting
|
||||
* Returns: boolean
|
||||
*/
|
||||
const getPreserveInteractionState = (): boolean => {
|
||||
const value = getSettingValue('preserve_interaction_state', 'true');
|
||||
const cleanValue = typeof value === 'string' ? value.replace(/"/g, '') : value;
|
||||
return cleanValue === 'true' || cleanValue === true;
|
||||
};
|
||||
|
||||
const getNotificationRecipients = () => {
|
||||
return getSettingValue('notifications.recipients', []);
|
||||
};
|
||||
|
||||
return {
|
||||
settings,
|
||||
isLoading,
|
||||
@@ -140,10 +164,13 @@ export function useAdminSettings() {
|
||||
getRequireApproval,
|
||||
getBanDurations,
|
||||
getEmailAlertsEnabled,
|
||||
getNotificationRecipients,
|
||||
getReportThreshold,
|
||||
getAuditRetentionDays,
|
||||
getAutoCleanupEnabled,
|
||||
getAdminPanelRefreshMode,
|
||||
getAdminPanelPollInterval,
|
||||
getAutoRefreshStrategy,
|
||||
getPreserveInteractionState,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user