You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-10 00:05:42 +02:00
Desktop: Fixes #10382: Fix default values for plugin settings stored in settings.json
not applied (#10383)
This commit is contained in:
@ -2116,6 +2116,7 @@ class Setting extends BaseModel {
|
||||
}
|
||||
|
||||
// Low-level method to load a setting directly from the database. Should not be used in most cases.
|
||||
// Does not apply setting default values.
|
||||
public static async loadOne(key: string): Promise<CacheItem | null> {
|
||||
if (this.keyStorage(key) === SettingStorage.File) {
|
||||
let fileSettings = await this.fileHandler.load();
|
||||
@ -2126,10 +2127,14 @@ class Setting extends BaseModel {
|
||||
fileSettings = mergeGlobalAndLocalSettings(rootFileSettings, fileSettings);
|
||||
}
|
||||
|
||||
return {
|
||||
key,
|
||||
value: fileSettings[key],
|
||||
};
|
||||
if (key in fileSettings) {
|
||||
return {
|
||||
key,
|
||||
value: fileSettings[key],
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Always check in the database first, including for secure settings,
|
||||
|
Reference in New Issue
Block a user