Migrate legacy avatars enabled setting from localstorage

f8c631b4aa81dc1e16cbb4be6fac36251b0f3edb

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +8 -1Showing whitespace changes
public/scripts/power-user.js+8 -1
@@ -304,6 +304,7 @@ export let context_presets = [];
304304const storage_keys = {
305305 auto_connect_legacy: 'AutoConnectEnabled',
306306 auto_load_chat_legacy: 'AutoLoadChatEnabled',
307+ hideChatAvatars_legacy: 'hideChatAvatarsEnabled',
307308
308309 storyStringValidationCache: 'StoryStringValidationCache',
309310};
@@ -1422,9 +1423,10 @@ async function loadPowerUserSettings(settings, data) {
14221423 context_presets = data.context;
14231424 }
14241425
14251426 // These are still local storage. Delete in 1.12.7
14261427 const autoLoadChat = localStorage.getItem(storage_keys.auto_load_chat_legacy);
14271428 const autoConnect = localStorage.getItem(storage_keys.auto_connect_legacy);
1429+ const hideChatAvatars = localStorage.getItem(storage_keys.hideChatAvatars_legacy);
14281430
14291431 if (autoLoadChat) {
14301432 power_user.auto_load_chat = autoLoadChat === 'true';
@@ -1436,6 +1438,11 @@ async function loadPowerUserSettings(settings, data) {
14361438 localStorage.removeItem(storage_keys.auto_connect_legacy);
14371439 }
14381440
1441+ if (hideChatAvatars) {
1442+ power_user.hideChatAvatars_enabled = hideChatAvatars === 'true';
1443+ localStorage.removeItem(storage_keys.hideChatAvatars_legacy);
1444+ }
1445+
14391446 if (power_user.chat_display === '') {
14401447 power_user.chat_display = chat_styles.DEFAULT;
14411448 }