1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Install default plugins on first app start (#6585)

This commit is contained in:
Mayank Bondre
2022-09-01 16:14:33 +05:30
committed by GitHub
parent 1069d7d6fb
commit 01f4bb0591
14 changed files with 382 additions and 7 deletions

View File

@@ -1576,6 +1576,13 @@ class Setting extends BaseModel {
public: false,
},
installedDefaultPlugins: {
value: [],
type: SettingItemType.Array,
public: false,
storage: SettingStorage.Database,
},
// 'featureFlag.syncAccurateTimestamps': {
// value: false,
// type: SettingItemType.Bool,
@@ -1954,6 +1961,17 @@ class Setting extends BaseModel {
return this.setValue(key, !this.value(key));
}
// this method checks if the 'value' passed is present in the Setting "Array"
// If yes, then it just returns 'true'. If its not present then, it will
// update it and return 'false'
public static setArrayValue(settingName: string, value: string): boolean {
const settingValue: Array<any> = this.value(settingName);
if (settingValue.includes(value)) return true;
settingValue.push(value);
this.setValue(settingName, settingValue);
return false;
}
static objectValue(settingKey: string, objectKey: string, defaultValue: any = null) {
const o = this.value(settingKey);
if (!o || !(objectKey in o)) return defaultValue;