Fix chat width when switching themes

This commit is contained in:
Cohee
2023-07-22 18:09:50 +03:00
parent eccfadb14e
commit 80fad96b1f

View File

@ -534,6 +534,11 @@ async function applyTheme(name) {
{
key: 'chat_width',
action: async () => {
// If chat width is not set, set it to 50
if (!power_user.chat_width) {
power_user.chat_width = 50;
}
localStorage.setItem(storage_keys.chat_width, power_user.chat_width);
applyChatWidth();
}
@ -660,6 +665,10 @@ function loadPowerUserSettings(settings, data) {
power_user.waifuMode = false;
}
if (power_user.chat_width === '') {
power_user.chat_width = 50;
}
$('#trim_spaces').prop("checked", power_user.trim_spaces);
$('#continue_on_send').prop("checked", power_user.continue_on_send);
$('#auto_swipe').prop("checked", power_user.auto_swipe);