1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +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:
Laurent Cozic
2021-06-19 15:56:37 +01:00
parent b7b12f9369
commit ab9bbcbff2
5 changed files with 66 additions and 22 deletions

View File

@ -65,6 +65,7 @@ export default class JoplinSettings {
if ('minimum' in setting) internalSettingItem.minimum = setting.minimum;
if ('maximum' in setting) internalSettingItem.maximum = setting.maximum;
if ('step' in setting) internalSettingItem.step = setting.step;
if ('storage' in setting) internalSettingItem.storage = setting.storage;
await Setting.registerSetting(this.namespacedKey(key), internalSettingItem);
}

View File

@ -334,6 +334,11 @@ export enum SettingItemType {
Button = 6,
}
export enum SettingStorage {
Database = 1,
File = 2,
}
// Redefine a simplified interface to mask internal details
// and to remove function calls as they would have to be async.
export interface SettingItem {
@ -393,6 +398,11 @@ export interface SettingItem {
minimum?: number;
maximum?: number;
step?: number;
/**
* Either store the setting in the database or in settings.json. Defaults to database.
*/
storage?: SettingStorage;
}
export interface SettingSection {