feat(config): better handling of config changes

This commit is contained in:
Alexey Kasyanchuk
2023-06-02 00:22:02 +03:00
parent 320e169fcc
commit 280298caa3
2 changed files with 11 additions and 7 deletions

View File

@ -619,9 +619,6 @@ module.exports = async ({
if(upnp)
upnp.ratsUnmap()
if (config.darkMode != options.darkMode)
send('changeDarkMode', options.darkMode)
for(const option in options)
{
if(option in config)
@ -639,6 +636,11 @@ module.exports = async ({
{
spider.announceHashes = []
}
const copyConfig = Object.assign({}, config);
delete copyConfig['load'];
delete copyConfig['reload'];
send('configChanged', copyConfig)
if(typeof callback === 'function')
callback(true)