* Improve typescript null checking in places * Iterate * Fix Timer.ts
This commit is contained in:
committed by
GitHub
parent
97506cbcdb
commit
9743852380
@@ -130,7 +130,7 @@ export default abstract class BasePlatform {
|
||||
if (MatrixClientPeg.userRegisteredWithinLastHours(24)) return false;
|
||||
|
||||
try {
|
||||
const [version, deferUntil] = JSON.parse(localStorage.getItem(UPDATE_DEFER_KEY));
|
||||
const [version, deferUntil] = JSON.parse(localStorage.getItem(UPDATE_DEFER_KEY)!);
|
||||
return newVersion !== version || Date.now() > deferUntil;
|
||||
} catch (e) {
|
||||
return true;
|
||||
@@ -211,7 +211,7 @@ export default abstract class BasePlatform {
|
||||
metricsTrigger: "Notification",
|
||||
};
|
||||
|
||||
if (ev.getThread()) {
|
||||
if (ev?.getThread()) {
|
||||
payload.event_id = ev.getId();
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ export default abstract class BasePlatform {
|
||||
return false;
|
||||
}
|
||||
|
||||
public getSettingValue(settingName: string): Promise<any> {
|
||||
public async getSettingValue(settingName: string): Promise<any> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ export default abstract class BasePlatform {
|
||||
public setSpellCheckEnabled(enabled: boolean): void {}
|
||||
|
||||
public async getSpellCheckEnabled(): Promise<boolean> {
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public setSpellCheckLanguages(preferredLangs: string[]): void {}
|
||||
@@ -333,7 +333,7 @@ export default abstract class BasePlatform {
|
||||
// persist hs url and is url for when the user is returned to the app with the login token
|
||||
localStorage.setItem(SSO_HOMESERVER_URL_KEY, mxClient.getHomeserverUrl());
|
||||
if (mxClient.getIdentityServerUrl()) {
|
||||
localStorage.setItem(SSO_ID_SERVER_URL_KEY, mxClient.getIdentityServerUrl());
|
||||
localStorage.setItem(SSO_ID_SERVER_URL_KEY, mxClient.getIdentityServerUrl()!);
|
||||
}
|
||||
if (idpId) {
|
||||
localStorage.setItem(SSO_IDP_ID_KEY, idpId);
|
||||
|
||||
Reference in New Issue
Block a user