fix power_user.movingUIState not saving properly

This commit is contained in:
RossAscends
2024-05-20 12:56:48 +09:00
parent 8d2b7a15dc
commit 863e0c3643

View File

@@ -1389,7 +1389,7 @@ async function applyTheme(name) {
} }
async function applyMovingUIPreset(name) { async function applyMovingUIPreset(name) {
resetMovablePanels('quiet'); await resetMovablePanels('quiet');
const movingUIPreset = movingUIPresets.find(x => x.name == name); const movingUIPreset = movingUIPresets.find(x => x.name == name);
if (!movingUIPreset) { if (!movingUIPreset) {
@@ -1401,6 +1401,7 @@ async function applyMovingUIPreset(name) {
console.log('MovingUI Preset applied: ' + name); console.log('MovingUI Preset applied: ' + name);
loadMovingUIState(); loadMovingUIState();
saveSettingsDebounced()
} }
/** /**
@@ -3789,15 +3790,18 @@ $(document).ready(() => {
browser_has_focus = false; browser_has_focus = false;
}); });
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'vn', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'vn',
callback: toggleWaifu, callback: toggleWaifu,
helpString: 'Swaps Visual Novel Mode On/Off', helpString: 'Swaps Visual Novel Mode On/Off',
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'newchat', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'newchat',
callback: doNewChat, callback: doNewChat,
helpString: 'Start a new chat with the current character', helpString: 'Start a new chat with the current character',
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'random', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'random',
callback: doRandomChat, callback: doRandomChat,
unnamedArgumentList: [ unnamedArgumentList: [
new SlashCommandArgument( new SlashCommandArgument(
@@ -3806,7 +3810,8 @@ $(document).ready(() => {
], ],
helpString: 'Start a new chat with a random character. If an argument is provided, only considers characters that have the specified tag.', helpString: 'Start a new chat with a random character. If an argument is provided, only considers characters that have the specified tag.',
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'delmode', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'delmode',
callback: doDelMode, callback: doDelMode,
aliases: ['del'], aliases: ['del'],
unnamedArgumentList: [ unnamedArgumentList: [
@@ -3816,7 +3821,8 @@ $(document).ready(() => {
], ],
helpString: 'Enter message deletion mode, and auto-deletes last N messages if numeric argument is provided.', helpString: 'Enter message deletion mode, and auto-deletes last N messages if numeric argument is provided.',
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'cut', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'cut',
callback: doMesCut, callback: doMesCut,
returns: 'the text of cut messages separated by a newline', returns: 'the text of cut messages separated by a newline',
unnamedArgumentList: [ unnamedArgumentList: [
@@ -3842,16 +3848,19 @@ $(document).ready(() => {
`, `,
aliases: [], aliases: [],
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'resetpanels', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'resetpanels',
callback: doResetPanels, callback: doResetPanels,
helpString: 'resets UI panels to original state', helpString: 'resets UI panels to original state',
aliases: ['resetui'], aliases: ['resetui'],
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'bgcol', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'bgcol',
callback: setAvgBG, callback: setAvgBG,
helpString: ' WIP test of auto-bg avg coloring', helpString: ' WIP test of auto-bg avg coloring',
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'theme', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'theme',
callback: setThemeCallback, callback: setThemeCallback,
unnamedArgumentList: [ unnamedArgumentList: [
new SlashCommandArgument( new SlashCommandArgument(
@@ -3860,7 +3869,8 @@ $(document).ready(() => {
], ],
helpString: 'sets a UI theme by name', helpString: 'sets a UI theme by name',
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'movingui', SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'movingui',
callback: setmovingUIPreset, callback: setmovingUIPreset,
unnamedArgumentList: [ unnamedArgumentList: [
new SlashCommandArgument( new SlashCommandArgument(