SYNC: config fixed

This commit is contained in:
Jan Prochazka
2025-06-30 13:45:40 +02:00
committed by Diflow
parent 7242515e48
commit 92cbd1c69c
3 changed files with 11 additions and 3 deletions

View File

@@ -275,7 +275,11 @@ module.exports = {
if (process.env.STORAGE_DATABASE) { if (process.env.STORAGE_DATABASE) {
updated = { updated = {
...currentValue, ...currentValue,
...values, ..._.mapValues(values, v => {
if (v === true) return 'true';
if (v === false) return 'false';
return v;
}),
}; };
await storage.writeConfig({ await storage.writeConfig({
group: 'settings', group: 'settings',

View File

@@ -126,7 +126,7 @@ async function sendToAuditLog(
} }
const config = require('../controllers/config'); const config = require('../controllers/config');
const settings = await config.getCachedSettings(); const settings = await config.getCachedSettings();
if (settings?.['storage.useAuditLog'] != 1) { if (settings?.['storage.useAuditLog'] != 'true') {
return; return;
} }

View File

@@ -13,7 +13,11 @@
<CheckboxField <CheckboxField
{...$$restProps} {...$$restProps}
checked={$values?.[name] == 0 ? false : $values?.[name] == '1' ? true : ($values?.[name] ?? defaultValue)} checked={$values?.[name] == 0 || $values?.[name] == 'false'
? false
: $values?.[name] == '1' || $values?.[name] == 'true'
? true
: ($values?.[name] ?? defaultValue)}
on:change={handleChange} on:change={handleChange}
on:change on:change
/> />