mirror of https://github.com/keeweb/keeweb.git
save plugin gallery in desktop
This commit is contained in:
parent
2efb2911b1
commit
41656b76b6
|
@ -46,7 +46,10 @@ const SettingsStore = {
|
|||
return new Promise(resolve => {
|
||||
if (Launcher) {
|
||||
const settingsFile = Launcher.getUserDataPath(this.fileName(key));
|
||||
Launcher.writeFile(settingsFile, JSON.stringify(data), err => {
|
||||
if (typeof data !== 'string') {
|
||||
data = JSON.stringify(data);
|
||||
}
|
||||
Launcher.writeFile(settingsFile, data, err => {
|
||||
if (err) {
|
||||
logger.error(`Error saving ${key}`, err);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ const kdbxweb = require('kdbxweb');
|
|||
const Links = require('../const/links');
|
||||
const SignatureVerifier = require('../util/signature-verifier');
|
||||
const Logger = require('../util/logger');
|
||||
const Launcher = require('../comp/launcher');
|
||||
const SettingsStore = require('../comp/settings-store');
|
||||
|
||||
const PluginGallery = {
|
||||
logger: new Logger('plugin-gallery'),
|
||||
|
@ -39,6 +41,9 @@ const PluginGallery = {
|
|||
return;
|
||||
}
|
||||
this.logger.debug(`Loaded ${gallery.plugins.length} plugins`, this.logger.ts(ts));
|
||||
if (Launcher) {
|
||||
this.saveGallery(data);
|
||||
}
|
||||
resolve(gallery);
|
||||
}).catch(e => {
|
||||
this.logger.error('Error verifying plugins signature', e);
|
||||
|
@ -58,6 +63,10 @@ const PluginGallery = {
|
|||
Backbone.trigger('plugin-gallery-load-complete');
|
||||
return gallery;
|
||||
});
|
||||
},
|
||||
|
||||
saveGallery(data) {
|
||||
SettingsStore.save('plugin-gallery', data);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue