You've already forked joplin
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user