Infer redux types when possible

This commit is contained in:
Alejandro Celaya
2025-11-14 14:21:14 +01:00
parent 145765e3fa
commit ae7aea0e2c
11 changed files with 18 additions and 38 deletions

View File

@@ -1,12 +1,6 @@
import type { ShlinkState } from '../../container/types';
export const migrateDeprecatedSettings = (state: Partial<ShlinkState>): Partial<ShlinkState> => {
if (!state.settings) {
return state;
}
export const migrateDeprecatedSettings = (state: any): any => {
// The "last180Days" interval had a typo, with a lowercase d
if (state.settings.visits && (state.settings.visits.defaultInterval as any) === 'last180days') {
if (state.settings?.visits?.defaultInterval === 'last180days') {
state.settings.visits.defaultInterval = 'last180Days';
}