1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop: Resolves #591: Add support for multiple profiles (#6385)

This commit is contained in:
Laurent
2022-04-11 16:49:32 +01:00
committed by GitHub
parent 58bf93a112
commit 6458ad0540
32 changed files with 919 additions and 154 deletions

View File

@ -0,0 +1,22 @@
import Setting from '../../models/Setting';
export default (rootSettings: Record<string, any>, subProfileSettings: Record<string, any>) => {
const output: Record<string, any> = { ...subProfileSettings };
for (const k of Object.keys(output)) {
const md = Setting.settingMetadata(k);
if (md.isGlobal) {
delete output[k];
if (k in rootSettings) output[k] = rootSettings[k];
}
}
for (const k of Object.keys(rootSettings)) {
const md = Setting.settingMetadata(k);
if (md.isGlobal) {
output[k] = rootSettings[k];
}
}
return output;
};