Skip to content

Commit 8356ad7

Browse files
authored
Merge pull request element-hq#2553 from vector-im/dbkr/get_app_version
Support for get_app_version
2 parents 69eee7c + 8d46077 commit 8356ad7

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/vector/platform/ElectronPlatform.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ limitations under the License.
1919

2020
import VectorBasePlatform from './VectorBasePlatform';
2121
import dis from 'matrix-react-sdk/lib/dispatcher';
22+
import q from 'q';
2223

2324
const electron = require('electron');
2425
const remote = electron.remote;
@@ -84,6 +85,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
8485
notif.close();
8586
}
8687

88+
getAppVersion() {
89+
return q(electron.remote.app.getVersion());
90+
}
91+
8792
pollForUpdate() {
8893
// In electron we control the update process ourselves, since
8994
// it needs to run in the main process, so we just run the timer

‎src/vector/platform/WebPlatform.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ export default class WebPlatform extends VectorBasePlatform {
144144
return deferred.promise;
145145
}
146146

147+
getAppVersion() {
148+
if (this.runningVersion !== null) {
149+
return q(this.runningVersion);
150+
}
151+
return this._getVersion();
152+
}
153+
147154
pollForUpdate() {
148155
this._getVersion().done((ver) => {
149156
if (this.runningVersion == null) {

0 commit comments

Comments
 (0)