add global getters
This commit is contained in:
parent
e1456f530c
commit
01b7e81f44
|
@ -44,7 +44,7 @@ export default class {
|
|||
* returns {String}
|
||||
*/
|
||||
static get contentPath() {
|
||||
return this._contentPath ? this._contentPath : (this._contentPath = Globals.getObject('paths').find(path => path.id === this.pathId).path);
|
||||
return Globals.getPath(this.pathId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -63,4 +63,16 @@ export default new class extends Module {
|
|||
return this.state[name];
|
||||
}
|
||||
|
||||
getPath(id) {
|
||||
return this.state.paths.find(path => path.id === id).path;
|
||||
}
|
||||
|
||||
static get paths() {
|
||||
return this.state.paths;
|
||||
}
|
||||
|
||||
static get version() {
|
||||
return this.state.version;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -133,6 +133,6 @@ export default new class Settings {
|
|||
}
|
||||
|
||||
get dataPath() {
|
||||
return this._dataPath ? this._dataPath : (this._dataPath = Globals.getObject('paths').find(p => p.id === 'data').path);
|
||||
return Globals.getPath('data');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,8 +48,8 @@ export default class {
|
|||
try {
|
||||
Events.emit('update-check-end');
|
||||
Logger.info('Updater',
|
||||
`Latest Version: ${e.version} - Current Version: ${Globals.getObject('version')}`);
|
||||
if (e.version !== Globals.getObject('version')) {
|
||||
`Latest Version: ${e.version} - Current Version: ${Globals.version}`);
|
||||
if (e.version !== Globals.version) {
|
||||
this.updatesAvailable = true;
|
||||
Events.emit('updates-available');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue