Give contextual feedback for manual update check instead of banner

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-05-29 18:24:45 +01:00
parent c68f35060a
commit 1fd74f22c8
3 changed files with 31 additions and 67 deletions

View file

@ -18,8 +18,7 @@ limitations under the License.
*/
import BasePlatform from 'matrix-react-sdk/src/BasePlatform';
import { _t } from 'matrix-react-sdk/src/languageHandler';
import dis from 'matrix-react-sdk/src/dispatcher/dispatcher';
import {_t} from 'matrix-react-sdk/src/languageHandler';
import {getVectorConfig} from "../getconfig";
import Favicon from "../../favicon";
@ -36,14 +35,12 @@ export const updateCheckStatusEnum = {
* Vector-specific extensions to the BasePlatform template
*/
export default abstract class VectorBasePlatform extends BasePlatform {
protected showUpdateCheck: boolean = false;
protected _favicon: Favicon;
constructor() {
super();
this.startUpdateCheck = this.startUpdateCheck.bind(this);
this.stopUpdateCheck = this.stopUpdateCheck.bind(this);
}
async getConfig(): Promise<{}> {
@ -96,33 +93,6 @@ export default abstract class VectorBasePlatform extends BasePlatform {
startUpdater() {
}
/**
* Whether we can call checkForUpdate on this platform build
*/
async canSelfUpdate(): Promise<boolean> {
return false;
}
startUpdateCheck() {
this.showUpdateCheck = true;
dis.dispatch({
action: 'check_updates',
value: { status: updateCheckStatusEnum.CHECKING },
});
}
stopUpdateCheck() {
this.showUpdateCheck = false;
dis.dispatch({
action: 'check_updates',
value: false,
});
}
getUpdateCheckStatusEnum() {
return updateCheckStatusEnum;
}
/**
* Update the currently running app to the latest available
* version and replace this instance of the app with the