forked from matrix/element-web
Support for get_app_version
This commit is contained in:
parent
0441fcf3df
commit
8d46077ac2
|
@ -19,6 +19,7 @@ limitations under the License.
|
||||||
|
|
||||||
import VectorBasePlatform from './VectorBasePlatform';
|
import VectorBasePlatform from './VectorBasePlatform';
|
||||||
import dis from 'matrix-react-sdk/lib/dispatcher';
|
import dis from 'matrix-react-sdk/lib/dispatcher';
|
||||||
|
import q from 'q';
|
||||||
|
|
||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
const remote = electron.remote;
|
const remote = electron.remote;
|
||||||
|
@ -84,6 +85,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
notif.close();
|
notif.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAppVersion() {
|
||||||
|
return q(electron.remote.app.getVersion());
|
||||||
|
}
|
||||||
|
|
||||||
pollForUpdate() {
|
pollForUpdate() {
|
||||||
// In electron we control the update process ourselves, since
|
// In electron we control the update process ourselves, since
|
||||||
// it needs to run in the main process, so we just run the timer
|
// it needs to run in the main process, so we just run the timer
|
||||||
|
|
|
@ -144,6 +144,13 @@ export default class WebPlatform extends VectorBasePlatform {
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAppVersion() {
|
||||||
|
if (this.runningVersion !== null) {
|
||||||
|
return q(this.runningVersion);
|
||||||
|
}
|
||||||
|
return this._getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
pollForUpdate() {
|
pollForUpdate() {
|
||||||
this._getVersion().done((ver) => {
|
this._getVersion().done((ver) => {
|
||||||
if (this.runningVersion == null) {
|
if (this.runningVersion == null) {
|
||||||
|
|
Loading…
Reference in New Issue