mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 01:51:12 -05:00
Reverted to commit de2d4a495f
This commit is contained in:
@@ -57,7 +57,7 @@ export function sortModerationItems(
|
||||
export function getDefaultSortConfig(): SortConfig {
|
||||
return {
|
||||
field: 'created_at',
|
||||
direction: 'desc', // Newest first by default
|
||||
direction: 'asc',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -71,7 +71,16 @@ export function loadSortConfig(key: string = 'moderationQueue_sortConfig'): Sort
|
||||
try {
|
||||
const saved = localStorage.getItem(key);
|
||||
if (saved) {
|
||||
return JSON.parse(saved);
|
||||
const config = JSON.parse(saved);
|
||||
|
||||
// Migrate old 'username' sort to 'created_at'
|
||||
if (config.field === 'username') {
|
||||
console.warn('[Sort] Migrating deprecated username sort to created_at');
|
||||
config.field = 'created_at';
|
||||
saveSortConfig(config, key); // Save the migrated config
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load sort config:', error);
|
||||
|
||||
Reference in New Issue
Block a user