Abstract electron settings properly to avoid boilerplate-hell (#22491)

* Remove unused method `BasePlatform::screenCaptureErrorString`

* Extract SeshatIndexManager into its own file

* Improve platform typescripting

* Consolidate IPC call promisification into IPCManager

* Abstract electron settings properly to avoid boilerplate-hell

* i18n

* Iterate PR
This commit is contained in:
Michael Telatynski 2022-06-10 22:38:46 +01:00 committed by GitHub
parent 867fc30ebf
commit 2c0965c240
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 283 additions and 311 deletions

View file

@ -30,11 +30,11 @@ import Favicon from "../../favicon";
export default abstract class VectorBasePlatform extends BasePlatform {
protected _favicon: Favicon;
async getConfig(): Promise<IConfigOptions> {
public async getConfig(): Promise<IConfigOptions> {
return getVectorConfig();
}
getHumanReadableName(): string {
public getHumanReadableName(): string {
return 'Vector Base Platform'; // no translation required: only used for analytics
}
@ -43,7 +43,7 @@ export default abstract class VectorBasePlatform extends BasePlatform {
* it uses canvas, which can trigger a permission prompt in Firefox's resist fingerprinting mode.
* See https://github.com/vector-im/element-web/issues/9605.
*/
get favicon() {
public get favicon() {
if (this._favicon) {
return this._favicon;
}
@ -62,13 +62,13 @@ export default abstract class VectorBasePlatform extends BasePlatform {
this.favicon.badge(notif, { bgColor });
}
setNotificationCount(count: number) {
public setNotificationCount(count: number) {
if (this.notificationCount === count) return;
super.setNotificationCount(count);
this.updateFavicon();
}
setErrorStatus(errorDidOccur: boolean) {
public setErrorStatus(errorDidOccur: boolean) {
if (this.errorDidOccur === errorDidOccur) return;
super.setErrorStatus(errorDidOccur);
this.updateFavicon();
@ -77,14 +77,14 @@ export default abstract class VectorBasePlatform extends BasePlatform {
/**
* Begin update polling, if applicable
*/
startUpdater() {
public startUpdater() {
}
/**
* Get a sensible default display name for the
* device Vector is running on
*/
getDefaultDeviceDisplayName(): string {
public getDefaultDeviceDisplayName(): string {
return _t("Unknown device");
}
}