mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix in-memory config not updating after import
This commit is contained in:
@@ -5653,18 +5653,20 @@
|
||||
|
||||
// Apply imported configuration
|
||||
async function applyImportedConfig(importedConfig, modalInstance) {
|
||||
// Save to JavaScript Injector
|
||||
// Update in-memory config before reopen (getKefinTweaksConfig reads window.KefinTweaksConfig)
|
||||
window.KefinTweaksConfig = importedConfig;
|
||||
window.KefinTweaksCurrentConfig = importedConfig;
|
||||
currentLoadedConfig = importedConfig;
|
||||
window.KefinTweaksConfigEnabled = importedConfig.enabled !== false;
|
||||
|
||||
await KefinTweaksUtils.saveConfigToJavaScriptInjector(importedConfig);
|
||||
|
||||
// Reload the modal with new config
|
||||
|
||||
modalInstance.close();
|
||||
|
||||
// Show success message
|
||||
|
||||
if (window.KefinTweaksToaster && window.KefinTweaksToaster.toast) {
|
||||
window.KefinTweaksToaster.toast('Configuration imported successfully! Reloading...');
|
||||
}
|
||||
|
||||
// Reopen modal with new config after a short delay
|
||||
|
||||
setTimeout(() => {
|
||||
openConfigurationModal();
|
||||
}, 500);
|
||||
@@ -6029,6 +6031,11 @@
|
||||
defaultConfig.kefinTweaksRoot = existingConfig.kefinTweaksRoot;
|
||||
// Note: scriptRoot is no longer used - scripts are loaded from kefinTweaksRoot + '/scripts/'
|
||||
|
||||
window.KefinTweaksConfig = defaultConfig;
|
||||
window.KefinTweaksCurrentConfig = defaultConfig;
|
||||
currentLoadedConfig = defaultConfig;
|
||||
window.KefinTweaksConfigEnabled = defaultConfig.enabled !== false;
|
||||
|
||||
await KefinTweaksUtils.saveConfigToJavaScriptInjector(defaultConfig);
|
||||
|
||||
if (window.KefinTweaksToaster && window.KefinTweaksToaster.toast) {
|
||||
|
||||
Reference in New Issue
Block a user