mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 14:06:19 +00:00
Created new settings card for tags-related options
This commit is contained in:
17
src/settings/helpers/index.ts
Normal file
17
src/settings/helpers/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ShlinkState } from '../../container/types';
|
||||
|
||||
export const migrateDeprecatedSettings = (state: ShlinkState): ShlinkState => {
|
||||
// The "last180Days" interval had a typo, with a lowercase d
|
||||
if ((state.settings.visits?.defaultInterval as any) === 'last180days') {
|
||||
state.settings.visits && (state.settings.visits.defaultInterval = 'last180Days');
|
||||
}
|
||||
|
||||
// The "tags display mode" option has been moved from "ui" to "tags"
|
||||
state.settings.tags = {
|
||||
...state.settings.tags,
|
||||
defaultMode: state.settings.tags?.defaultMode ?? (state.settings.ui as any)?.tagsMode,
|
||||
};
|
||||
state.settings.ui && delete (state.settings.ui as any).tagsMode;
|
||||
|
||||
return state;
|
||||
};
|
||||
Reference in New Issue
Block a user