Migrate legacy avatars enabled setting from localstorage
| @@ -304,6 +304,7 @@ export let context_presets = []; | |||
| 304 | const storage_keys = { | 304 | const storage_keys = { |
| 305 | auto_connect_legacy: 'AutoConnectEnabled', | 305 | auto_connect_legacy: 'AutoConnectEnabled', |
| 306 | auto_load_chat_legacy: 'AutoLoadChatEnabled', | 306 | auto_load_chat_legacy: 'AutoLoadChatEnabled', |
| 307 | hideChatAvatars_legacy: 'hideChatAvatarsEnabled', | ||
| 307 | 308 | ||
| 308 | storyStringValidationCache: 'StoryStringValidationCache', | 309 | storyStringValidationCache: 'StoryStringValidationCache', |
| 309 | }; | 310 | }; |
| @@ -1422,9 +1423,10 @@ async function loadPowerUserSettings(settings, data) { | |||
| 1422 | context_presets = data.context; | 1423 | context_presets = data.context; |
| 1423 | } | 1424 | } |
| 1424 | 1425 | ||
| 1425 | // These are still local storage | 1426 | // These are still local storage. Delete in 1.12.7 |
| 1426 | const autoLoadChat = localStorage.getItem(storage_keys.auto_load_chat_legacy); | 1427 | const autoLoadChat = localStorage.getItem(storage_keys.auto_load_chat_legacy); |
| 1427 | const autoConnect = localStorage.getItem(storage_keys.auto_connect_legacy); | 1428 | const autoConnect = localStorage.getItem(storage_keys.auto_connect_legacy); |
| 1429 | const hideChatAvatars = localStorage.getItem(storage_keys.hideChatAvatars_legacy); | ||
| 1428 | 1430 | ||
| 1429 | if (autoLoadChat) { | 1431 | if (autoLoadChat) { |
| 1430 | power_user.auto_load_chat = autoLoadChat === 'true'; | 1432 | power_user.auto_load_chat = autoLoadChat === 'true'; |
| @@ -1436,6 +1438,11 @@ async function loadPowerUserSettings(settings, data) { | |||
| 1436 | localStorage.removeItem(storage_keys.auto_connect_legacy); | 1438 | localStorage.removeItem(storage_keys.auto_connect_legacy); |
| 1437 | } | 1439 | } |
| 1438 | 1440 | ||
| 1441 | if (hideChatAvatars) { | ||
| 1442 | power_user.hideChatAvatars_enabled = hideChatAvatars === 'true'; | ||
| 1443 | localStorage.removeItem(storage_keys.hideChatAvatars_legacy); | ||
| 1444 | } | ||
| 1445 | |||
| 1439 | if (power_user.chat_display === '') { | 1446 | if (power_user.chat_display === '') { |
| 1440 | power_user.chat_display = chat_styles.DEFAULT; | 1447 | power_user.chat_display = chat_styles.DEFAULT; |
| 1441 | } | 1448 | } |