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