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);
@ -1151,10 +1160,10 @@ async function resetMovablePanels(type) {
//if happening as part of preset application, do it quietly.
if (type === 'quiet') {
return
//if happening due to resize, tell user.
//if happening due to resize, tell user.
} else if (type === 'resize') {
toastr.warning('Panel positions reset due to zoom/resize');
//if happening due to manual button press
//if happening due to manual button press
} else {
toastr.success('Panel positions reset');
}