You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Plugins: Fixed saving secure settings to the keychain, and added way to store plugin settings to settings.json
This commit is contained in:
@@ -1363,10 +1363,18 @@ class Setting extends BaseModel {
|
||||
}
|
||||
|
||||
// Low-level method to load a setting directly from the database. Should not be used in most cases.
|
||||
public static async loadOne(key: string) {
|
||||
public static async loadOne(key: string): Promise<CacheItem> {
|
||||
if (this.keyStorage(key) === SettingStorage.File) {
|
||||
const fromFile = await this.fileHandler.load();
|
||||
return fromFile[key];
|
||||
return {
|
||||
key,
|
||||
value: fromFile[key],
|
||||
};
|
||||
} else if (this.settingMetadata(key).secure) {
|
||||
return {
|
||||
key,
|
||||
value: await this.keychainService().password(`setting.${key}`),
|
||||
};
|
||||
} else {
|
||||
return this.modelSelectOne('SELECT * FROM settings WHERE key = ?', [key]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user