mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 18:59:17 +00:00
Enable oxlint rule typescript/no-floating-promises (#34586)
* Enable oxlint rule `typescript/no-floating-promises` * Iterate
This commit is contained in:
committed by
GitHub
parent
33dcc89c2f
commit
eadc43ddf4
@@ -147,7 +147,7 @@ async function available(): Promise<boolean> {
|
||||
if (major < 21) {
|
||||
// If the macOS version is too old for modern Electron support then disable auto update to prevent the app updating and bricking itself.
|
||||
// The oldest macOS version supported by Chromium/Electron 38 is Monterey (12.x) which started with Darwin 21.0
|
||||
initialisePromise.then(() => {
|
||||
await initialisePromise.then(() => {
|
||||
ipcMain.emit("showToast", {
|
||||
title: _t("eol|title"),
|
||||
description: _t("eol|no_more_updates", { brand: getConfig().brand }),
|
||||
@@ -158,7 +158,7 @@ async function available(): Promise<boolean> {
|
||||
} else if (major < 22) {
|
||||
// If the macOS version is EOL then show a warning message.
|
||||
// The oldest macOS version still supported by Apple is Ventura (13.x) which started with Darwin 22.0
|
||||
initialisePromise.then(() => {
|
||||
await initialisePromise.then(() => {
|
||||
ipcMain.emit("showToast", {
|
||||
title: _t("eol|title"),
|
||||
description: _t("eol|warning", { brand: getConfig().brand }),
|
||||
|
||||
@@ -40,8 +40,8 @@ function bundleSubject(baseUrl, bundle) {
|
||||
const fetcher = new rxjs.BehaviorSubject(Pending.of());
|
||||
bundleCache.set(bundle, fetcher);
|
||||
|
||||
fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => {
|
||||
res.body.cancel(); /* Bail on the download immediately - it could be big! */
|
||||
void fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => {
|
||||
void res.body.cancel(); /* Bail on the download immediately - it could be big! */
|
||||
const status = res.ok;
|
||||
if (status) {
|
||||
fetcher.next(Success.of());
|
||||
@@ -100,7 +100,7 @@ function fetchAsSubject(endpoint) {
|
||||
const fetcher = new rxjs.BehaviorSubject(Pending.of());
|
||||
fetchCache.set(endpoint, fetcher);
|
||||
|
||||
fetch(endpoint).then((res) => {
|
||||
void fetch(endpoint).then((res) => {
|
||||
if (!res.ok) {
|
||||
fetcher.next(FetchError.of(`Failed to fetch endpoint ${endpoint}: ${res.status} ${res.statusText}`));
|
||||
return;
|
||||
|
||||
@@ -271,7 +271,7 @@ function loadVideoElement(videoFile: File): Promise<HTMLVideoElement> {
|
||||
|
||||
video.src = dataUrl;
|
||||
video.load();
|
||||
video.play();
|
||||
void video.play();
|
||||
};
|
||||
reader.onerror = function (e): void {
|
||||
reject(e);
|
||||
|
||||
@@ -142,7 +142,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
MatrixClientPeg.safeGet().on(CallEventHandlerEvent.Incoming, this.onCallIncoming);
|
||||
}
|
||||
|
||||
this.checkProtocols(CHECK_PROTOCOLS_ATTEMPTS);
|
||||
void this.checkProtocols(CHECK_PROTOCOLS_ATTEMPTS);
|
||||
}
|
||||
|
||||
public stop(): void {
|
||||
@@ -171,7 +171,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
if (!callId || this.isForcedSilent()) return;
|
||||
this.silencedCalls.delete(callId);
|
||||
this.emit(LegacyCallHandlerEvent.SilencedCallsChanged, this.silencedCalls);
|
||||
this.play(AudioID.Ring);
|
||||
void this.play(AudioID.Ring);
|
||||
}
|
||||
|
||||
public isCallSilenced(callId?: string): boolean {
|
||||
@@ -221,7 +221,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
} else {
|
||||
logger.log("Failed to check for protocol support: will retry", e);
|
||||
window.setTimeout(() => {
|
||||
this.checkProtocols(maxTries - 1);
|
||||
void this.checkProtocols(maxTries - 1);
|
||||
}, 10000);
|
||||
}
|
||||
}
|
||||
@@ -506,14 +506,14 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
);
|
||||
|
||||
if (pushRuleEnabled && tweakSetToRing && !this.isForcedSilent()) {
|
||||
this.play(AudioID.Ring);
|
||||
void this.play(AudioID.Ring);
|
||||
} else {
|
||||
this.silenceCall(call.callId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CallState.InviteSent: {
|
||||
this.play(AudioID.Ringback);
|
||||
void this.play(AudioID.Ringback);
|
||||
break;
|
||||
}
|
||||
case CallState.Ended: {
|
||||
@@ -523,7 +523,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
}
|
||||
|
||||
if (oldState === CallState.InviteSent && call.hangupParty === CallParty.Remote) {
|
||||
this.play(AudioID.Busy);
|
||||
void this.play(AudioID.Busy);
|
||||
|
||||
// Don't show a modal when we got rejected/the call was hung up
|
||||
if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) break;
|
||||
@@ -550,11 +550,11 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
});
|
||||
} else if (oldState !== CallState.Fledgling && oldState !== CallState.Ringing) {
|
||||
// don't play the end-call sound for calls that never got off the ground
|
||||
this.play(AudioID.CallEnd);
|
||||
void this.play(AudioID.CallEnd);
|
||||
}
|
||||
|
||||
if (isNotNull(mappedRoomId)) {
|
||||
this.logCallStats(call, mappedRoomId);
|
||||
void this.logCallStats(call, mappedRoomId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -671,8 +671,8 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
true,
|
||||
);
|
||||
|
||||
finished.then(([allow]) => {
|
||||
SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow ?? null);
|
||||
void finished.then(([allow]) => {
|
||||
void SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow ?? null);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -733,9 +733,9 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
this.setActiveCallRoomId(roomId);
|
||||
|
||||
if (type === CallType.Voice) {
|
||||
call.placeVoiceCall();
|
||||
await call.placeVoiceCall();
|
||||
} else if (type === "video") {
|
||||
call.placeVideoCall();
|
||||
await call.placeVideoCall();
|
||||
} else {
|
||||
logger.error("Unknown conf call type: " + type);
|
||||
}
|
||||
@@ -838,7 +838,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
return;
|
||||
}
|
||||
|
||||
call.answer();
|
||||
void call.answer();
|
||||
this.setActiveCallRoomId(roomId);
|
||||
dis.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
@@ -886,7 +886,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
if (consultFirst) {
|
||||
// if we're consulting, we just start by placing a call to the transfer
|
||||
// target (passing the transferee so the actual transfer can happen later)
|
||||
this.dialNumber(destination, call);
|
||||
await this.dialNumber(destination, call);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -914,7 +914,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
return;
|
||||
}
|
||||
|
||||
this.placeCall(dmRoomId, call.type, call);
|
||||
await this.placeCall(dmRoomId, call.type, call);
|
||||
dis.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
room_id: dmRoomId,
|
||||
@@ -1004,7 +1004,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
|
||||
const messaging = WidgetMessagingStore.instance.getMessagingForUid(WidgetUtils.getWidgetUid(w));
|
||||
if (!messaging?.widgetApi) return; // more "should never happen" words
|
||||
|
||||
messaging.widgetApi.transport.send(ElementWidgetActions.HangupCall, {});
|
||||
void messaging.widgetApi.transport.send(ElementWidgetActions.HangupCall, {});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,7 @@ const ID_SERVER_URL_KEY = "mx_is_url";
|
||||
|
||||
dis.register((payload) => {
|
||||
if (payload.action === Action.TriggerLogout) {
|
||||
// noinspection JSIgnoredPromiseFromCall - we don't care if it fails
|
||||
onLoggedOut();
|
||||
void onLoggedOut();
|
||||
} else if (payload.action === Action.OverwriteLogin) {
|
||||
const typed = <OverwriteLoginPayload>payload;
|
||||
// Stop the current client before overwriting the login.
|
||||
@@ -485,7 +484,7 @@ function onFailedDelegatedAuthLogin(description: string | ReactNode, tryAgain?:
|
||||
button: _t("action|try_again"),
|
||||
});
|
||||
|
||||
finished.then(([shouldTryAgain]) => {
|
||||
void finished.then(([shouldTryAgain]) => {
|
||||
// if we have a tryAgain callback, call it the primary 'try again' button was clicked in the dialog
|
||||
if (shouldTryAgain) tryAgain?.();
|
||||
});
|
||||
@@ -970,7 +969,7 @@ export async function logout(): Promise<void> {
|
||||
}
|
||||
|
||||
_isLoggingOut = true;
|
||||
PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? "");
|
||||
void PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? "");
|
||||
|
||||
doLogout(client, oauth ?? null).then(onLoggedOut, (err) => {
|
||||
// Just throwing an error here is going to be very unhelpful
|
||||
@@ -981,7 +980,7 @@ export async function logout(): Promise<void> {
|
||||
// tokens expire (and if you really think you've been compromised,
|
||||
// change your password).
|
||||
logger.warn("Failed to call logout API: token will not be invalidated", err);
|
||||
onLoggedOut();
|
||||
return onLoggedOut();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1077,10 +1076,9 @@ async function startMatrixClient(
|
||||
|
||||
CallStatusListener.sharedInstance().start(CallStore.instance, client);
|
||||
|
||||
// Similarly, don't start sending presence updates until we've started
|
||||
// the client
|
||||
// Similarly, don't start sending presence updates until we've started the client
|
||||
if (!SettingsStore.getValue("lowBandwidth")) {
|
||||
Presence.start();
|
||||
void Presence.start();
|
||||
}
|
||||
|
||||
// Now that we have a MatrixClientPeg, update the Jitsi info
|
||||
@@ -1199,8 +1197,8 @@ export function stopMatrixClient(unsetClient = true): void {
|
||||
|
||||
if (unsetClient) {
|
||||
MatrixClientPeg.unset();
|
||||
EventIndexPeg.unset();
|
||||
cli.store.destroy();
|
||||
void EventIndexPeg.unset();
|
||||
void cli.store.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
|
||||
private onUnexpectedStoreClose = async (): Promise<void> => {
|
||||
if (!this.matrixClient) return;
|
||||
this.matrixClient.stopClient(); // stop the client as the database has failed
|
||||
this.matrixClient.store.destroy();
|
||||
void this.matrixClient.store.destroy();
|
||||
|
||||
if (!this.matrixClient.isGuest()) {
|
||||
// If the user is not a guest then prompt them to reload rather than doing it for them
|
||||
@@ -282,7 +282,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
|
||||
if (SettingsStore.getValue("feature_simplified_sliding_sync")) {
|
||||
opts.slidingSync = await SlidingSyncManager.instance.setup(this.matrixClient);
|
||||
} else {
|
||||
SlidingSyncManager.instance.checkSupport(this.matrixClient);
|
||||
void SlidingSyncManager.instance.checkSupport(this.matrixClient);
|
||||
}
|
||||
|
||||
// Connect the matrix client to the dispatcher and setting handlers
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class MediaDeviceHandler extends EventEmitter {
|
||||
}
|
||||
|
||||
public setAudioOutput(deviceId: string): void {
|
||||
SettingsStore.setValue("webrtc_audiooutput", null, SettingLevel.DEVICE, deviceId);
|
||||
void SettingsStore.setValue("webrtc_audiooutput", null, SettingLevel.DEVICE, deviceId);
|
||||
this.emit(MediaDeviceHandlerEvent.AudioOutputChanged, deviceId);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ export default class MediaDeviceHandler extends EventEmitter {
|
||||
* @param {string} deviceId
|
||||
*/
|
||||
public async setAudioInput(deviceId: string): Promise<void> {
|
||||
SettingsStore.setValue("webrtc_audioinput", null, SettingLevel.DEVICE, deviceId);
|
||||
void SettingsStore.setValue("webrtc_audioinput", null, SettingLevel.DEVICE, deviceId);
|
||||
return MatrixClientPeg.safeGet().getMediaHandler().setAudioInput(deviceId);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ export default class MediaDeviceHandler extends EventEmitter {
|
||||
* @param {string} deviceId
|
||||
*/
|
||||
public async setVideoInput(deviceId: string): Promise<void> {
|
||||
SettingsStore.setValue("webrtc_videoinput", null, SettingLevel.DEVICE, deviceId);
|
||||
void SettingsStore.setValue("webrtc_videoinput", null, SettingLevel.DEVICE, deviceId);
|
||||
return MatrixClientPeg.safeGet().getMediaHandler().setVideoInput(deviceId);
|
||||
}
|
||||
|
||||
@@ -204,13 +204,13 @@ export default class MediaDeviceHandler extends EventEmitter {
|
||||
return SettingsStore.getValue("audioInputMuted");
|
||||
}
|
||||
public static set startWithAudioMuted(value: boolean) {
|
||||
SettingsStore.setValue("audioInputMuted", null, SettingLevel.DEVICE, value);
|
||||
void SettingsStore.setValue("audioInputMuted", null, SettingLevel.DEVICE, value);
|
||||
}
|
||||
|
||||
public static get startWithVideoMuted(): boolean {
|
||||
return SettingsStore.getValue("videoInputMuted");
|
||||
}
|
||||
public static set startWithVideoMuted(value: boolean) {
|
||||
SettingsStore.setValue("videoInputMuted", null, SettingLevel.DEVICE, value);
|
||||
void SettingsStore.setValue("videoInputMuted", null, SettingLevel.DEVICE, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
|
||||
this.modals = [];
|
||||
this.staticModal = null;
|
||||
this.priorityModal = null;
|
||||
this.reRender();
|
||||
void this.reRender();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,7 +289,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
|
||||
this.modals = [];
|
||||
}
|
||||
|
||||
this.reRender();
|
||||
void this.reRender();
|
||||
this.emitClosed();
|
||||
},
|
||||
modal.deferred.promise,
|
||||
@@ -355,7 +355,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
|
||||
this.modals.unshift(modal);
|
||||
}
|
||||
|
||||
this.reRender();
|
||||
void this.reRender();
|
||||
this.emitIfChanged(beforeModal);
|
||||
|
||||
return {
|
||||
@@ -374,7 +374,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
|
||||
|
||||
this.modals.push(modal);
|
||||
|
||||
this.reRender();
|
||||
void this.reRender();
|
||||
this.emitIfChanged(beforeModal);
|
||||
|
||||
return {
|
||||
|
||||
@@ -370,12 +370,12 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
|
||||
// make sure that we persist the current setting audio_enabled setting
|
||||
// before changing anything
|
||||
if (SettingsStore.isLevelSupported(SettingLevel.DEVICE)) {
|
||||
SettingsStore.setValue("audioNotificationsEnabled", null, SettingLevel.DEVICE, this.isEnabled());
|
||||
void SettingsStore.setValue("audioNotificationsEnabled", null, SettingLevel.DEVICE, this.isEnabled());
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
// Attempt to get permission from user
|
||||
plaf.requestNotificationPermission().then((result) => {
|
||||
void plaf.requestNotificationPermission().then((result) => {
|
||||
if (result !== "granted") {
|
||||
// The permission request was dismissed or denied
|
||||
// TODO: Support alternative branding in messaging
|
||||
@@ -490,7 +490,7 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
|
||||
|
||||
// wait for first non-cached sync to complete
|
||||
if (![SyncState.Stopped, SyncState.Error].includes(state) && !data?.fromCache) {
|
||||
createLocalNotificationSettingsIfNeeded(this.sdkContext.client);
|
||||
void createLocalNotificationSettingsIfNeeded(this.sdkContext.client);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -508,7 +508,7 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
|
||||
if (ev.getSender() === this.sdkContext.client.getUserId()) return;
|
||||
if (data.timeline.getTimelineSet().threadListType !== null) return; // Ignore events on the thread list generated timelines
|
||||
|
||||
this.sdkContext.client.decryptEventIfNeeded(ev);
|
||||
void this.sdkContext.client.decryptEventIfNeeded(ev);
|
||||
|
||||
// If it's an encrypted event and the type is still 'm.room.encrypted',
|
||||
// it hasn't yet been decrypted, so wait until it is.
|
||||
@@ -585,7 +585,7 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
|
||||
}
|
||||
if (actions.tweaks.sound && this.isAudioEnabled()) {
|
||||
PlatformPeg.get()?.loudNotification(ev, room);
|
||||
this.playAudioNotification(ev, room);
|
||||
void this.playAudioNotification(ev, room);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ export class PosthogAnalytics {
|
||||
"pseudonymousAnalyticsOptIn",
|
||||
null,
|
||||
(originalSettingName, changedInRoomId, atLevel, newValueAtLevel, newValue) => {
|
||||
this.updateAnonymityFromSettings(client, !!newValue);
|
||||
void this.updateAnonymityFromSettings(client, !!newValue);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class Presence {
|
||||
while (this.unavailableTimer) {
|
||||
try {
|
||||
await this.unavailableTimer.finished();
|
||||
this.setState(SetPresence.Unavailable);
|
||||
await this.setState(SetPresence.Unavailable);
|
||||
} catch {
|
||||
/* aborted, stop got called */
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class Presence {
|
||||
|
||||
private onAction = (payload: ActionPayload): void => {
|
||||
if (payload.action === Action.UserActivity) {
|
||||
this.setState(SetPresence.Online);
|
||||
void this.setState(SetPresence.Online);
|
||||
this.unavailableTimer?.restart();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -63,7 +63,7 @@ export async function startAnyRegistrationFlow(
|
||||
]
|
||||
: [],
|
||||
});
|
||||
modal.finished.then(([proceed]) => {
|
||||
return modal.finished.then(([proceed]) => {
|
||||
if (proceed) {
|
||||
dis.dispatch({ action: "start_login", screenAfterLogin: options.screen_after });
|
||||
} else if (options.go_home_on_cancel) {
|
||||
|
||||
@@ -895,7 +895,7 @@ const onMessage = function (event: MessageEvent): void {
|
||||
setWidget(event, null);
|
||||
return;
|
||||
} else if (event.data.action === Action.GetOpenIdToken) {
|
||||
getOpenIdToken(event);
|
||||
void getOpenIdToken(event);
|
||||
return;
|
||||
} else {
|
||||
sendError(event, _t("scalar|error_missing_room_id_request"));
|
||||
@@ -928,16 +928,16 @@ const onMessage = function (event: MessageEvent): void {
|
||||
getMembershipCount(event, roomId);
|
||||
return;
|
||||
} else if (event.data.action === Action.GetRoomEncryptionState) {
|
||||
getRoomEncState(event, roomId);
|
||||
void getRoomEncState(event, roomId);
|
||||
return;
|
||||
} else if (event.data.action === Action.CanSendEvent) {
|
||||
canSendEvent(event, roomId);
|
||||
return;
|
||||
} else if (event.data.action === Action.SendEvent) {
|
||||
sendEvent(event, roomId);
|
||||
void sendEvent(event, roomId);
|
||||
return;
|
||||
} else if (event.data.action === Action.ReadEvents) {
|
||||
readEvents(event, roomId);
|
||||
void readEvents(event, roomId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -962,7 +962,7 @@ const onMessage = function (event: MessageEvent): void {
|
||||
setBotOptions(event, roomId, userId);
|
||||
break;
|
||||
case Action.SetBotPower:
|
||||
setBotPower(event, roomId, userId, event.data.level, event.data.ignoreIfGreater);
|
||||
void setBotPower(event, roomId, userId, event.data.level, event.data.ignoreIfGreater);
|
||||
break;
|
||||
default:
|
||||
logger.warn("Unhandled postMessage event with action '" + event.data.action + "'");
|
||||
|
||||
@@ -384,7 +384,7 @@ export class SlidingSyncManager {
|
||||
public async setup(client: MatrixClient): Promise<SlidingSync | undefined> {
|
||||
const slidingSync = this.configure(client, client.baseUrl);
|
||||
logger.info("Simplified Sliding Sync activated at", client.baseUrl);
|
||||
this.startSpidering(slidingSync, 50, 50); // 50 rooms at a time, 50ms apart
|
||||
void this.startSpidering(slidingSync, 50, 50); // 50 rooms at a time, 50ms apart
|
||||
return slidingSync;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ export default class UserActivity {
|
||||
dis.dispatch({ action: Action.UserActivity });
|
||||
if (!this.activeNowTimeout.isRunning()) {
|
||||
this.activeNowTimeout.start();
|
||||
UserActivity.runTimersUntilTimeout(this.attachedActiveNowTimers, this.activeNowTimeout);
|
||||
void UserActivity.runTimersUntilTimeout(this.attachedActiveNowTimers, this.activeNowTimeout);
|
||||
} else {
|
||||
this.activeNowTimeout.restart();
|
||||
}
|
||||
@@ -204,7 +204,7 @@ export default class UserActivity {
|
||||
if (!this.activeRecentlyTimeout.isRunning()) {
|
||||
this.activeRecentlyTimeout.start();
|
||||
|
||||
UserActivity.runTimersUntilTimeout(this.attachedActiveRecentlyTimers, this.activeRecentlyTimeout);
|
||||
void UserActivity.runTimersUntilTimeout(this.attachedActiveRecentlyTimers, this.activeRecentlyTimeout);
|
||||
} else {
|
||||
this.activeRecentlyTimeout.restart();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export default class ManageEventIndexDialog extends React.Component<IProps, ISta
|
||||
|
||||
private onCrawlerSleepTimeChange = (e: ChangeEvent<HTMLInputElement>): void => {
|
||||
this.setState({ crawlerSleepTime: parseInt(e.target.value, 10) });
|
||||
SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.valueAsNumber);
|
||||
void SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.valueAsNumber);
|
||||
};
|
||||
|
||||
public render(): React.ReactNode {
|
||||
|
||||
@@ -117,7 +117,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
|
||||
this.recoveryKey = {
|
||||
privateKey: keyFromCustomisations,
|
||||
};
|
||||
this.bootstrapSecretStorage();
|
||||
void this.bootstrapSecretStorage();
|
||||
}
|
||||
|
||||
private onKeyPassphraseChange = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
||||
@@ -268,11 +268,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
|
||||
};
|
||||
|
||||
private onLoadRetryClick = (): void => {
|
||||
this.bootstrapSecretStorage();
|
||||
void this.bootstrapSecretStorage();
|
||||
};
|
||||
|
||||
private onShowKeyContinueClick = (): void => {
|
||||
this.bootstrapSecretStorage();
|
||||
void this.bootstrapSecretStorage();
|
||||
};
|
||||
|
||||
private onCancelClick = (): void => {
|
||||
@@ -290,7 +290,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
|
||||
await this.passphraseField.current.validate({ allowEmpty: false });
|
||||
if (!this.passphraseField.current.state.valid) {
|
||||
this.passphraseField.current.focus();
|
||||
this.passphraseField.current.validate({ allowEmpty: false, focused: true });
|
||||
void this.passphraseField.current.validate({ allowEmpty: false, focused: true });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ export default class ExportE2eKeysDialog extends React.Component<IProps, IState>
|
||||
// Focus on the first invalid field, then re-validate,
|
||||
// which will result in the error tooltip being displayed for that field.
|
||||
invalidFields[0].focus();
|
||||
invalidFields[0].validate({ allowEmpty: false, focused: true });
|
||||
void invalidFields[0].validate({ allowEmpty: false, focused: true });
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,10 +85,9 @@ export default class ImportE2eKeysDialog extends React.Component<IProps, IState>
|
||||
|
||||
private onFormSubmit = (ev: React.FormEvent): boolean => {
|
||||
ev.preventDefault();
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
const file = this.file.current?.files?.[0];
|
||||
if (file) {
|
||||
this.startImport(file, this.state.passphrase);
|
||||
void this.startImport(file, this.state.passphrase);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function NewRecoveryMethodDialog({ onFinished }: NewRecoveryMetho
|
||||
setIsKeyBackupEnabled(Boolean(crypto && (await crypto.getActiveSessionBackupVersion()) !== null));
|
||||
};
|
||||
|
||||
checkBackupEnabled();
|
||||
void checkBackupEnabled();
|
||||
}, [matrixClient]);
|
||||
|
||||
function onClick(): void {
|
||||
@@ -51,7 +51,7 @@ export default function NewRecoveryMethodDialog({ onFinished }: NewRecoveryMetho
|
||||
onFinished();
|
||||
} else {
|
||||
const { finished } = Modal.createDialog(RestoreKeyBackupDialog, {}, undefined, false, true);
|
||||
finished.then(onFinished);
|
||||
void finished.then(onFinished);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export class BackgroundAudio {
|
||||
// that it can be reused. Suspending it while another sound is still going would cut that
|
||||
// one off mid-way and leave it to pick up again the next time anything is played.
|
||||
if (this.playing === 0) {
|
||||
this.audioContext.suspend();
|
||||
void this.audioContext.suspend();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -129,8 +129,7 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte
|
||||
public destroy(): void {
|
||||
// Dev note: It's critical that we call stop() during cleanup to ensure that downstream callers
|
||||
// are aware of the final clock position before the user triggered an unload.
|
||||
// noinspection JSIgnoredPromiseFromCall - not concerned about being called async here
|
||||
this.stop();
|
||||
void this.stop();
|
||||
this.removeAllListeners();
|
||||
this.clock.destroy();
|
||||
this.waveformObservable.close();
|
||||
|
||||
@@ -112,8 +112,7 @@ export class PlaybackQueue {
|
||||
const currentClockState = this.clockStates.get(mxEvent.getId()!);
|
||||
|
||||
if (newState === PlaybackState.Stopped && currentClockState !== undefined && !wasLastPlaying) {
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
playback.skipTo(currentClockState);
|
||||
void playback.skipTo(currentClockState);
|
||||
} else if (newState === PlaybackState.Stopped) {
|
||||
// Remove the now-useless clock for some space savings
|
||||
this.clockStates.delete(mxEvent.getId()!);
|
||||
@@ -137,8 +136,7 @@ export class PlaybackQueue {
|
||||
|
||||
// This should cause a Play event, which will re-populate our playback order
|
||||
// and update our current playback ID.
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
instance.play();
|
||||
void instance.play();
|
||||
}
|
||||
} else {
|
||||
// else no explicit next event, so find an event we haven't played that comes next. The live
|
||||
@@ -181,8 +179,7 @@ export class PlaybackQueue {
|
||||
|
||||
// This should cause a Play event, which will re-populate our playback order
|
||||
// and update our current playback ID.
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
instance?.play();
|
||||
void instance?.play();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -192,8 +192,8 @@ export class VoiceRecording extends EventEmitter implements IDestroyable {
|
||||
if (this.recorderSource) this.recorderSource.disconnect();
|
||||
if (this.recorder) this.recorder.close();
|
||||
if (this.recorderContext) {
|
||||
// noinspection ES6MissingAwait - not important that we wait
|
||||
this.recorderContext.close();
|
||||
// not important that we wait
|
||||
void this.recorderContext.close();
|
||||
}
|
||||
|
||||
throw e; // rethrow so upstream can handle it
|
||||
@@ -244,8 +244,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable {
|
||||
const secondsLeft = TARGET_MAX_LENGTH - this.recorderSeconds!;
|
||||
if (secondsLeft < 0) {
|
||||
// go over to make sure we definitely capture that last frame
|
||||
// noinspection JSIgnoredPromiseFromCall - we aren't concerned with it overlapping
|
||||
this.stop();
|
||||
void this.stop();
|
||||
} else if (secondsLeft <= TARGET_WARN_TIME_LEFT) {
|
||||
Singleflight.for(this, "ending_soon").do(() => {
|
||||
this.emit(RecordingState.EndingSoon, { secondsLeft });
|
||||
@@ -306,12 +305,10 @@ export class VoiceRecording extends EventEmitter implements IDestroyable {
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
// noinspection JSIgnoredPromiseFromCall - not concerned about stop() being called async here
|
||||
this.stop();
|
||||
void this.stop();
|
||||
this.removeAllListeners();
|
||||
this.onDataAvailable = undefined;
|
||||
Singleflight.forgetAllFor(this);
|
||||
// noinspection JSIgnoredPromiseFromCall - not concerned about being called async here
|
||||
this.observable?.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
|
||||
// We use fetch to inline the page into the react component
|
||||
// so that it can inherit CSS and theming easily rather than mess around
|
||||
// with iframes and trying to synchronise document.stylesheets.
|
||||
this.fetchEmbed();
|
||||
void this.fetchEmbed();
|
||||
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class FilePanel extends React.Component<IProps, IState> {
|
||||
if (toStartOfTimeline || !data || !data.liveEvent || ev.isRedacted()) return;
|
||||
|
||||
const client = MatrixClientPeg.safeGet();
|
||||
client.decryptEventIfNeeded(ev);
|
||||
void client.decryptEventIfNeeded(ev);
|
||||
|
||||
if (ev.isBeingDecrypted()) {
|
||||
this.decryptingEvents.add(ev.getId()!);
|
||||
|
||||
@@ -128,7 +128,7 @@ export default class InteractiveAuthComponent<T> extends React.Component<Interac
|
||||
|
||||
if (this.props.poll) {
|
||||
this.intervalId = window.setInterval(() => {
|
||||
this.authLogic.poll();
|
||||
void this.authLogic.poll();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ export default class InteractiveAuthComponent<T> extends React.Component<Interac
|
||||
}
|
||||
|
||||
private submitAuthDict = (authData: AuthDict): void => {
|
||||
this.authLogic.submitAuthDict(authData);
|
||||
void this.authLogic.submitAuthDict(authData);
|
||||
};
|
||||
|
||||
private onPhaseChange = (newPhase: number): void => {
|
||||
|
||||
@@ -158,7 +158,10 @@ export default class LegacyCallEventGrouper extends EventEmitter {
|
||||
public callBack = (): void => {
|
||||
const roomId = this.roomId;
|
||||
if (!roomId) return;
|
||||
SDKContextClass.instance.legacyCallHandler.placeCall(roomId, this.isVoice ? CallType.Voice : CallType.Video);
|
||||
void SDKContextClass.instance.legacyCallHandler.placeCall(
|
||||
roomId,
|
||||
this.isVoice ? CallType.Voice : CallType.Video,
|
||||
);
|
||||
};
|
||||
|
||||
public toggleSilenced = (): void => {
|
||||
|
||||
@@ -143,7 +143,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
// stash the MatrixClient in case we log out before we are unmounted
|
||||
this._matrixClient = this.props.matrixClient;
|
||||
|
||||
MediaDeviceHandler.loadDevices();
|
||||
void MediaDeviceHandler.loadDevices();
|
||||
|
||||
this._roomView = React.createRef();
|
||||
}
|
||||
@@ -152,11 +152,11 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
document.addEventListener("keydown", this.onNativeKeyDown, false);
|
||||
this.context.legacyCallHandler.addListener(LegacyCallHandlerEvent.CallState, this.onCallState);
|
||||
|
||||
this.updateServerNoticeEvents();
|
||||
void this.updateServerNoticeEvents();
|
||||
|
||||
this._matrixClient.on(ClientEvent.AccountData, this.onAccountData);
|
||||
// check push rules on start up as well
|
||||
monitorSyncedPushRules(this._matrixClient.getAccountData(EventType.PushRules), this._matrixClient);
|
||||
void monitorSyncedPushRules(this._matrixClient.getAccountData(EventType.PushRules), this._matrixClient);
|
||||
this._matrixClient.on(ClientEvent.Sync, this.onSync);
|
||||
// Call `onSync` with the current state as well
|
||||
this.onSync(this._matrixClient.getSyncState(), null, this._matrixClient.getSyncStateData() ?? undefined);
|
||||
@@ -183,7 +183,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
void this.onTimezoneUpdate();
|
||||
|
||||
OwnProfileStore.instance.on(UPDATE_EVENT, this.refreshBackgroundImage);
|
||||
this.refreshBackgroundImage();
|
||||
void this.refreshBackgroundImage();
|
||||
}
|
||||
|
||||
private getResizerViewModel(): ResizerViewModel {
|
||||
@@ -268,7 +268,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
if (event.getType() === "m.ignored_user_list") {
|
||||
dis.dispatch({ action: "ignore_state_changed" });
|
||||
}
|
||||
monitorSyncedPushRules(event, this._matrixClient);
|
||||
void monitorSyncedPushRules(event, this._matrixClient);
|
||||
};
|
||||
|
||||
private onCompactLayoutChanged = (): void => {
|
||||
@@ -288,7 +288,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
});
|
||||
|
||||
if (oldSyncState === SyncState.Prepared && syncState === SyncState.Syncing) {
|
||||
this.updateServerNoticeEvents();
|
||||
void this.updateServerNoticeEvents();
|
||||
} else {
|
||||
this.calculateServerLimitToast(syncErrorData, this.state.usageLimitEventContent);
|
||||
}
|
||||
@@ -297,7 +297,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
private onRoomStateEvents = (ev: MatrixEvent): void => {
|
||||
const serverNoticeList = RoomListStoreV3.instance.getServerNoticeRooms();
|
||||
if (serverNoticeList.some((r) => r.roomId === ev.getRoomId())) {
|
||||
this.updateServerNoticeEvents();
|
||||
void this.updateServerNoticeEvents();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -548,7 +548,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
undefined,
|
||||
false,
|
||||
);
|
||||
SettingsStore.setValue(
|
||||
void SettingsStore.setValue(
|
||||
"showHiddenEventsInTimeline",
|
||||
null,
|
||||
SettingLevel.DEVICE,
|
||||
|
||||
@@ -324,7 +324,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
// When the session loads it'll be detected as soft logged out and a dispatch
|
||||
// will be sent out to say that, triggering this MatrixChat to show the soft
|
||||
// logout page.
|
||||
Lifecycle.loadSession({ abortSignal: this.loadSessionAbortController.signal });
|
||||
void Lifecycle.loadSession({ abortSignal: this.loadSessionAbortController.signal });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -480,9 +480,9 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
this.fontWatcher = new FontWatcher();
|
||||
this.themeWatcher.start();
|
||||
this.themeWatcher.on(ThemeWatcherEvent.Change, setTheme);
|
||||
this.fontWatcher.start();
|
||||
void this.fontWatcher.start();
|
||||
|
||||
initSentry(SdkConfig.get("sentry"));
|
||||
void initSentry(SdkConfig.get("sentry"));
|
||||
window.addEventListener("resize", this.onWindowResized);
|
||||
|
||||
// Once we start loading the MatrixClient, we can't stop, even if MatrixChat gets unmounted (as it does
|
||||
@@ -684,15 +684,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
break;
|
||||
case "logout":
|
||||
this.stores.legacyCallHandler.hangupAllCalls();
|
||||
Promise.all([...CallStore.instance.connectedCalls].map((call) => call.disconnect())).finally(() =>
|
||||
void Promise.all([...CallStore.instance.connectedCalls].map((call) => call.disconnect())).finally(() =>
|
||||
Lifecycle.logout(),
|
||||
);
|
||||
break;
|
||||
case "require_registration":
|
||||
startAnyRegistrationFlow(payload as any);
|
||||
void startAnyRegistrationFlow(payload as any);
|
||||
break;
|
||||
case "start_mobile_registration":
|
||||
this.startRegistration(payload.params || {}, true);
|
||||
void this.startRegistration(payload.params || {}, true);
|
||||
break;
|
||||
case "start_registration":
|
||||
if (Lifecycle.isSoftLogout()) {
|
||||
@@ -703,7 +703,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
if (payload.screenAfterLogin) {
|
||||
this.screenAfterLogin = payload.screenAfterLogin;
|
||||
}
|
||||
this.startRegistration(payload.params || {});
|
||||
void this.startRegistration(payload.params || {});
|
||||
break;
|
||||
case "start_login":
|
||||
if (Lifecycle.isSoftLogout()) {
|
||||
@@ -724,7 +724,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
}
|
||||
break;
|
||||
case "start_chat":
|
||||
createRoom(MatrixClientPeg.safeGet(), {
|
||||
void createRoom(MatrixClientPeg.safeGet(), {
|
||||
dmUserId: payload.user_id,
|
||||
});
|
||||
break;
|
||||
@@ -735,7 +735,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
this.forgetRoom(payload.room_id);
|
||||
break;
|
||||
case "copy_room":
|
||||
this.copyRoom(payload.room_id);
|
||||
void this.copyRoom(payload.room_id);
|
||||
break;
|
||||
case "view_user_info":
|
||||
this.viewUser(payload.userId, payload.subAction);
|
||||
@@ -747,7 +747,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
event.getRoomId() === this.state.currentRoomId
|
||||
) {
|
||||
// re-view the current room so we can update alias/id in the URL properly
|
||||
this.viewRoom({
|
||||
void this.viewRoom({
|
||||
action: Action.ViewRoom,
|
||||
room_id: this.state.currentRoomId,
|
||||
metricsTrigger: undefined, // room doesn't change
|
||||
@@ -762,7 +762,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
// to them, supply the room alias. If both are supplied, the room ID will be ignored.
|
||||
const promise = this.viewRoom(payload as ViewRoomPayload);
|
||||
if (payload.deferred_action) {
|
||||
promise.then(() => {
|
||||
void promise.then(() => {
|
||||
dis.dispatch(payload.deferred_action);
|
||||
});
|
||||
}
|
||||
@@ -787,7 +787,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
break;
|
||||
}
|
||||
case Action.CreateRoom:
|
||||
this.createRoom(payload.public, payload.defaultName, payload.type);
|
||||
void this.createRoom(payload.public, payload.defaultName, payload.type);
|
||||
|
||||
// View the welcome or home page if we need something to look at
|
||||
this.viewSomethingBehindModal();
|
||||
@@ -900,11 +900,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
break;
|
||||
case Action.PseudonymousAnalyticsAccept:
|
||||
hideAnalyticsToast();
|
||||
SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, true);
|
||||
void SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, true);
|
||||
break;
|
||||
case Action.PseudonymousAnalyticsReject:
|
||||
hideAnalyticsToast();
|
||||
SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, false);
|
||||
void SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, false);
|
||||
break;
|
||||
case Action.ShowThread: {
|
||||
const { rootEvent, initialEvent, highlighted, scrollIntoView, push } = payload as ShowThreadPayload;
|
||||
@@ -1025,7 +1025,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
// Only the critical ones for a typical UI are
|
||||
// This will start the decryption process for all events when a
|
||||
// user views a room
|
||||
room.decryptAllEvents();
|
||||
void room.decryptAllEvents();
|
||||
const theAlias = Rooms.getDisplayAliasForRoom(room);
|
||||
if (theAlias) {
|
||||
presentedId = theAlias;
|
||||
@@ -1119,7 +1119,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
private viewUser(userId: string, subAction: string): void {
|
||||
// Wait for the first sync so that `getRoom` gives us a room object if it's
|
||||
// in the sync response
|
||||
this.firstSyncPromise.promise.then(() => {
|
||||
void this.firstSyncPromise.promise.then(() => {
|
||||
if (subAction === "chat") {
|
||||
this.chatCreateOrReuse(userId);
|
||||
return;
|
||||
@@ -1132,7 +1132,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
|
||||
private viewShare(format: ShareFormat, msg: string): void {
|
||||
// Wait for the first sync so we can present possible rooms to share into
|
||||
this.firstSyncPromise.promise.then(() => {
|
||||
void this.firstSyncPromise.promise.then(() => {
|
||||
this.notifyNewScreen("share");
|
||||
let rawEvent;
|
||||
switch (format) {
|
||||
@@ -1191,7 +1191,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
|
||||
const [shouldCreate, opts] = await modal.finished;
|
||||
if (shouldCreate) {
|
||||
createRoom(MatrixClientPeg.safeGet(), opts!);
|
||||
await createRoom(MatrixClientPeg.safeGet(), opts!);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1308,7 +1308,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
danger: warnings.length > 0,
|
||||
});
|
||||
|
||||
finished.then(async ([shouldLeave]) => {
|
||||
void finished.then(async ([shouldLeave]) => {
|
||||
if (shouldLeave) {
|
||||
await leaveRoomBehaviour(cli, roomId);
|
||||
|
||||
@@ -1508,7 +1508,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
* Handle an {@link Action.OnLoggedIn} action (i.e, we now have a client with working credentials).
|
||||
*/
|
||||
private onLoggedIn(): void {
|
||||
StorageManager.tryPersistStorage();
|
||||
void StorageManager.tryPersistStorage();
|
||||
|
||||
// If we're loading the app for the first time, we can now transition to a splash screen while we wait for the
|
||||
// client to start. The exceptions are:
|
||||
@@ -1629,7 +1629,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
}
|
||||
|
||||
// Re-apply theme now that account data (including custom_themes) is loaded, otherwise we might end up with the wrong theme applied if the user has custom themes enabled
|
||||
setTheme();
|
||||
void setTheme();
|
||||
|
||||
this.firstSyncComplete = true;
|
||||
this.firstSyncPromise.resolve();
|
||||
@@ -1685,7 +1685,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
finished.then(([confirmed]) => {
|
||||
void finished.then(([confirmed]) => {
|
||||
if (confirmed) {
|
||||
const wnd = window.open(consentUri, "_blank")!;
|
||||
wnd.opener = null;
|
||||
@@ -2061,7 +2061,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
const cli = MatrixClientPeg.get();
|
||||
if (!cli) return;
|
||||
|
||||
cli.sendEvent(roomId, event.getType() as keyof TimelineEvents, event.getContent()).then(() => {
|
||||
void cli.sendEvent(roomId, event.getType() as keyof TimelineEvents, event.getContent()).then(() => {
|
||||
dis.dispatch({ action: "message_sent" });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ export default class RightPanel extends React.Component<Props, IState> {
|
||||
this.state.cardState?.verificationRequest?.pending
|
||||
) {
|
||||
// When the user clicks close on the encryption panel cancel the pending request first if any
|
||||
this.state.cardState.verificationRequest.cancel();
|
||||
void this.state.cardState.verificationRequest.cancel();
|
||||
} else {
|
||||
RightPanelStore.instance.togglePanel(this.props.room?.roomId ?? null);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ export const RoomSearchView = ({ term, scope, promise, className, onUpdate, inPr
|
||||
// Mount & unmount effect
|
||||
useEffect(() => {
|
||||
aborted.current = false;
|
||||
handleSearchResult(promise);
|
||||
void handleSearchResult(promise);
|
||||
return () => {
|
||||
aborted.current = true;
|
||||
};
|
||||
|
||||
@@ -585,7 +585,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
createdByCurrentUserTs - lastCreatedByOtherTs < PREVENT_MULTIPLE_JITSI_WITHIN
|
||||
) {
|
||||
// more than one Jitsi widget with the last one from the current user → remove it
|
||||
WidgetUtils.setRoomWidget(this.context.client, this.state.roomId, createdByCurrentUser.id);
|
||||
void WidgetUtils.setRoomWidget(this.context.client, this.state.roomId, createdByCurrentUser.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1014,7 +1014,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
),
|
||||
];
|
||||
|
||||
this.onRoomViewStoreUpdate(true);
|
||||
void this.onRoomViewStoreUpdate(true);
|
||||
|
||||
const call = this.getCallForRoom();
|
||||
const callState = call?.state;
|
||||
@@ -1143,7 +1143,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
const action = getKeyBindingsManager().getRoomAction(ev);
|
||||
switch (action) {
|
||||
case KeyBindingAction.DismissReadMarker:
|
||||
this.messagePanel?.forgetReadMarker();
|
||||
void this.messagePanel?.forgetReadMarker();
|
||||
this.jumpToLiveTimeline();
|
||||
handled = true;
|
||||
break;
|
||||
@@ -1196,7 +1196,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
case "picture_snapshot": {
|
||||
const roomId = this.getRoomId();
|
||||
if (isNotUndefined(roomId)) {
|
||||
ContentMessages.sharedInstance().sendContentListToRoom(
|
||||
void ContentMessages.sharedInstance().sendContentListToRoom(
|
||||
[payload.file],
|
||||
roomId,
|
||||
undefined,
|
||||
@@ -1225,7 +1225,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
payload.event?.getRoomId() === this.state.roomId &&
|
||||
payload.context === TimelineRenderingType.Search
|
||||
) {
|
||||
this.onCancelSearchClick();
|
||||
void this.onCancelSearchClick();
|
||||
// we don't need to re-dispatch as RoomViewStore knows to persist with context=Search also
|
||||
}
|
||||
break;
|
||||
@@ -1238,7 +1238,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
},
|
||||
() => {
|
||||
// send another "initial" RVS update to trigger peeking if needed
|
||||
if (isReadyNow) this.onRoomViewStoreUpdate(true);
|
||||
if (isReadyNow) void this.onRoomViewStoreUpdate(true);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1357,7 +1357,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
|
||||
private onLocalRoomEvent(roomId: string): void {
|
||||
if (!this.context.client || !this.state.room || roomId !== this.state.room.roomId) return;
|
||||
createRoomFromLocalRoom(this.context.client, this.state.room as LocalRoom);
|
||||
void createRoomFromLocalRoom(this.context.client, this.state.room as LocalRoom);
|
||||
}
|
||||
|
||||
private onRoomTimeline = (
|
||||
@@ -1380,7 +1380,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
}
|
||||
|
||||
if (ev.getType() === "m.room.encryption") {
|
||||
this.updateE2EStatus(room);
|
||||
void this.updateE2EStatus(room);
|
||||
this.updatePreviewUrlVisibility();
|
||||
}
|
||||
|
||||
@@ -1462,11 +1462,11 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
this.context.widgetLayoutStore.on(WidgetLayoutStore.emissionForRoom(room), this.onWidgetLayoutChange);
|
||||
|
||||
this.calculatePeekRules(room);
|
||||
this.loadMembersIfJoined(room);
|
||||
this.calculateRecommendedVersion(room);
|
||||
void this.loadMembersIfJoined(room);
|
||||
void this.calculateRecommendedVersion(room);
|
||||
this.updatePermissions(room);
|
||||
this.checkWidgets(room);
|
||||
this.updateRoomEncrypted(room);
|
||||
void this.updateRoomEncrypted(room);
|
||||
|
||||
if (
|
||||
this.getMainSplitContentType(room) !== MainSplitContentType.Timeline &&
|
||||
@@ -1574,13 +1574,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
if (!room || !room.currentState.getMember(userId)) {
|
||||
return;
|
||||
}
|
||||
this.updateE2EStatus(room);
|
||||
void this.updateE2EStatus(room);
|
||||
};
|
||||
|
||||
private onCrossSigningKeysChanged = (): void => {
|
||||
const room = this.state.room;
|
||||
if (room) {
|
||||
this.updateE2EStatus(room);
|
||||
void this.updateE2EStatus(room);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1647,7 +1647,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
private onMyMembership = (room: Room): void => {
|
||||
if (room.roomId === this.state.roomId) {
|
||||
this.forceUpdate();
|
||||
this.loadMembersIfJoined(room);
|
||||
void this.loadMembersIfJoined(room);
|
||||
this.updatePermissions(room);
|
||||
}
|
||||
};
|
||||
@@ -1674,7 +1674,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
() => {
|
||||
if (!this.state.room) return;
|
||||
this.updateDMState();
|
||||
this.updateE2EStatus(this.state.room);
|
||||
void this.updateE2EStatus(this.state.room);
|
||||
},
|
||||
500,
|
||||
{ leading: true, trailing: true },
|
||||
@@ -1696,7 +1696,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
}
|
||||
const dmInviter = room?.getDMInviter();
|
||||
if (dmInviter) {
|
||||
Rooms.setDMRoom(room.client, room.roomId, dmInviter);
|
||||
void Rooms.setDMRoom(room.client, room.roomId, dmInviter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1715,7 +1715,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
});
|
||||
defaultDispatcher.dispatch({ action: "require_registration" });
|
||||
} else {
|
||||
Promise.resolve().then(() => {
|
||||
void Promise.resolve().then(() => {
|
||||
const signUrl = this.props.threepidInvite?.signUrl;
|
||||
const roomId = this.getRoomId();
|
||||
if (isNotUndefined(roomId)) {
|
||||
@@ -1983,7 +1983,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
// update the read marker to match the read-receipt
|
||||
private forgetReadMarker = (ev: ButtonEvent): void => {
|
||||
ev.stopPropagation();
|
||||
this.messagePanel?.forgetReadMarker();
|
||||
void this.messagePanel?.forgetReadMarker();
|
||||
};
|
||||
|
||||
// decide whether or not the top 'unread messages' bar should be shown
|
||||
@@ -2199,8 +2199,8 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
private onFocus = (): void => {
|
||||
if (this.props.enableReadReceiptsAndMarkersOnActivity) return;
|
||||
|
||||
this.messagePanel?.sendReadReceipts();
|
||||
this.messagePanel?.updateReadMarker();
|
||||
void this.messagePanel?.sendReadReceipts();
|
||||
void this.messagePanel?.updateReadMarker();
|
||||
};
|
||||
|
||||
public render(): ReactNode {
|
||||
|
||||
@@ -229,8 +229,7 @@ export default class ScrollPanel extends React.Component<IProps> {
|
||||
this.saveScrollState();
|
||||
this.updatePreventShrinking();
|
||||
this.props.onScroll?.(ev);
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.checkFillState();
|
||||
void this.checkFillState();
|
||||
};
|
||||
|
||||
private onResize = (): void => {
|
||||
@@ -249,10 +248,8 @@ export default class ScrollPanel extends React.Component<IProps> {
|
||||
return;
|
||||
}
|
||||
// We don't care if these two conditions race - they're different trees.
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.restoreSavedScrollState();
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.checkFillState(0, isFromPropsUpdate);
|
||||
void this.restoreSavedScrollState();
|
||||
void this.checkFillState(0, isFromPropsUpdate);
|
||||
};
|
||||
|
||||
// return true if the content is fully scrolled down right now; else false.
|
||||
@@ -408,8 +405,7 @@ export default class ScrollPanel extends React.Component<IProps> {
|
||||
const refillDueToPropsUpdate = this.pendingFillDueToPropsUpdate;
|
||||
this.fillRequestWhileRunning = false;
|
||||
this.pendingFillDueToPropsUpdate = false;
|
||||
// noinspection ES6MissingAwait
|
||||
this.checkFillState(0, refillDueToPropsUpdate);
|
||||
void this.checkFillState(0, refillDueToPropsUpdate);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@ const SpaceSetupPrivateInvite: React.FC<{
|
||||
if (valid === false) {
|
||||
// true/null are allowed
|
||||
fieldRef.current!.focus();
|
||||
fieldRef.current!.validate({ allowEmpty: true, focused: true });
|
||||
void fieldRef.current!.validate({ allowEmpty: true, focused: true });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,8 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
|
||||
|
||||
useEffect(() => {
|
||||
const room = mxClient.getRoom(roomId);
|
||||
room?.createThreadsTimelineSets()
|
||||
void room
|
||||
?.createThreadsTimelineSets()
|
||||
.then(() => room.fetchRoomThreads())
|
||||
.then(() => {
|
||||
setFilterOption(ThreadFilterType.All);
|
||||
|
||||
@@ -110,7 +110,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
|
||||
);
|
||||
|
||||
if (this.state.thread) {
|
||||
this.postThreadUpdate(this.state.thread);
|
||||
void this.postThreadUpdate(this.state.thread);
|
||||
}
|
||||
|
||||
this.setupThread(this.props.mxEvent);
|
||||
|
||||
@@ -312,10 +312,10 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
this.props.timelineSet.room?.on(ThreadEvent.Update, this.onThreadUpdate);
|
||||
|
||||
if (this.props.manageReadReceipts && this.props.enableReadReceiptsAndMarkersOnActivity) {
|
||||
this.updateReadReceiptOnUserActivity();
|
||||
void this.updateReadReceiptOnUserActivity();
|
||||
}
|
||||
if (this.props.manageReadMarkers && this.props.enableReadReceiptsAndMarkersOnActivity) {
|
||||
this.updateReadMarkerOnUserActivity();
|
||||
void this.updateReadMarkerOnUserActivity();
|
||||
}
|
||||
this.initTimeline(this.props);
|
||||
}
|
||||
@@ -706,7 +706,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
// timeline window.
|
||||
//
|
||||
// see https://github.com/vector-im/vector-web/issues/1035
|
||||
this.timelineWindow!.paginate(EventTimeline.FORWARDS, 1, false).then(() => {
|
||||
void this.timelineWindow!.paginate(EventTimeline.FORWARDS, 1, false).then(() => {
|
||||
if (this.unmounted) {
|
||||
return;
|
||||
}
|
||||
@@ -738,7 +738,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
// we know we're stuckAtBottom, so we can advance the RM
|
||||
// immediately, to save a later render cycle
|
||||
|
||||
this.setReadMarker(lastLiveEvent.getId() ?? null, lastLiveEvent.getTs(), true);
|
||||
void this.setReadMarker(lastLiveEvent.getId() ?? null, lastLiveEvent.getTs(), true);
|
||||
updatedState.readMarkerVisible = false;
|
||||
updatedState.readMarkerEventId = lastLiveEvent.getId();
|
||||
callRMUpdated = true;
|
||||
@@ -1228,7 +1228,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
i--;
|
||||
|
||||
const ev = events[i];
|
||||
this.setReadMarker(ev.getId()!, ev.getTs());
|
||||
void this.setReadMarker(ev.getId()!, ev.getTs());
|
||||
}
|
||||
|
||||
/* jump down to the bottom of this room, where new events are arriving
|
||||
@@ -1537,7 +1537,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
});
|
||||
if (onFinished) {
|
||||
// oxlint-disable-next-line promise/no-promise-in-callback
|
||||
finished.then(onFinished);
|
||||
void finished.then(onFinished);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1555,7 +1555,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
if (this.props.timelineSet.getTimelineForEvent(eventId)) {
|
||||
// if we've got an eventId, and the timeline exists, we can skip
|
||||
// the promise tick.
|
||||
this.timelineWindow.load(eventId, INITIAL_SIZE);
|
||||
void this.timelineWindow.load(eventId, INITIAL_SIZE);
|
||||
// in this branch this method will happen in sync time
|
||||
onLoaded();
|
||||
return;
|
||||
@@ -1599,7 +1599,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||
// We want the last event to be decrypted first
|
||||
const client = MatrixClientPeg.safeGet();
|
||||
for (let i = events.length - 1; i >= 0; --i) {
|
||||
client.decryptEventIfNeeded(events[i]);
|
||||
void client.decryptEventIfNeeded(events[i]);
|
||||
}
|
||||
|
||||
// Hold onto the live events separately. The read receipt and read marker
|
||||
|
||||
@@ -43,7 +43,7 @@ export default class UserView extends React.Component<IProps, IState> {
|
||||
|
||||
public componentDidMount(): void {
|
||||
if (this.props.userId) {
|
||||
this.loadProfileInfo();
|
||||
void this.loadProfileInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export default class UserView extends React.Component<IProps, IState> {
|
||||
// it as optional and MatrixChat sometimes fires in a way which results
|
||||
// in an NPE when we try to update the profile info.
|
||||
if (prevProps.userId !== this.props.userId && this.props.userId) {
|
||||
this.loadProfileInfo();
|
||||
void this.loadProfileInfo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
|
||||
prevProps.serverConfig.isUrl !== this.props.serverConfig.isUrl
|
||||
) {
|
||||
// Do a liveliness check on the new URLs
|
||||
this.checkServerLiveliness(this.props.serverConfig);
|
||||
void this.checkServerLiveliness(this.props.serverConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
|
||||
// Focus on the first invalid field, then re-validate,
|
||||
// which will result in the error tooltip being displayed for that field.
|
||||
invalidFields[0].focus();
|
||||
invalidFields[0].validate({ allowEmpty: false, focused: true });
|
||||
await invalidFields[0].validate({ allowEmpty: false, focused: true });
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -309,13 +309,13 @@ export default class ForgotPassword extends React.Component<Props, State> {
|
||||
|
||||
switch (this.state.phase) {
|
||||
case Phase.EnterEmail:
|
||||
this.onPhaseEmailInputSubmit();
|
||||
await this.onPhaseEmailInputSubmit();
|
||||
break;
|
||||
case Phase.EmailSent:
|
||||
this.onPhaseEmailSentSubmit();
|
||||
await this.onPhaseEmailSentSubmit();
|
||||
break;
|
||||
case Phase.PasswordInput:
|
||||
this.onPhasePasswordInputSubmit();
|
||||
await this.onPhasePasswordInputSubmit();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -126,7 +126,7 @@ class LoginComponent extends React.PureComponent<IProps, IState> {
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.unmounted = false;
|
||||
this.initLoginLogic(this.props.serverConfig);
|
||||
void this.initLoginLogic(this.props.serverConfig);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
@@ -142,7 +142,7 @@ class LoginComponent extends React.PureComponent<IProps, IState> {
|
||||
prevProps.serverConfig.delegatedAuthentication !== this.props.serverConfig.delegatedAuthentication
|
||||
) {
|
||||
// Ensure that we end up actually logging in to the right place
|
||||
this.initLoginLogic(this.props.serverConfig);
|
||||
void this.initLoginLogic(this.props.serverConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.replaceClient(this.props.serverConfig);
|
||||
void this.replaceClient(this.props.serverConfig);
|
||||
//triggers a confirmation dialog for data loss before page unloads/refreshes
|
||||
window.addEventListener("beforeunload", this.unloadCallback);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
prevProps.serverConfig.hsUrl !== this.props.serverConfig.hsUrl ||
|
||||
prevProps.serverConfig.isUrl !== this.props.serverConfig.isUrl
|
||||
) {
|
||||
this.replaceClient(this.props.serverConfig);
|
||||
void this.replaceClient(this.props.serverConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
clearTimeout(this.rateLimitTimer);
|
||||
this.rateLimitTimer = setTimeout(() => {
|
||||
this.rateLimitTimer = undefined;
|
||||
this.replaceClient(this.props.serverConfig);
|
||||
void this.replaceClient(this.props.serverConfig);
|
||||
}, retryAfterMs);
|
||||
}
|
||||
} else {
|
||||
@@ -460,7 +460,7 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
accessToken,
|
||||
});
|
||||
|
||||
this.setupPushers();
|
||||
void this.setupPushers();
|
||||
}
|
||||
} else {
|
||||
newState.busy = false;
|
||||
@@ -508,7 +508,7 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
private onGoToFormClicked = (ev: ButtonEvent): void => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
this.replaceClient(this.props.serverConfig);
|
||||
void this.replaceClient(this.props.serverConfig);
|
||||
this.setState({
|
||||
busy: false,
|
||||
doingUIAuth: false,
|
||||
|
||||
@@ -94,7 +94,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
|
||||
|
||||
private onUsePassphraseClick = async (): Promise<void> => {
|
||||
const store = SetupEncryptionStore.sharedInstance();
|
||||
store.usePassPhrase();
|
||||
await store.usePassPhrase();
|
||||
};
|
||||
|
||||
private onVerifyClick = (): void => {
|
||||
@@ -110,9 +110,9 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
|
||||
member: cli.getUser(userId) ?? undefined,
|
||||
});
|
||||
|
||||
verificationFinished.then(async () => {
|
||||
void verificationFinished.then(async () => {
|
||||
const request = await requestPromise;
|
||||
request.cancel();
|
||||
void request.cancel();
|
||||
this.props.onFinished();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -79,16 +79,16 @@ export default class SoftLogout extends React.Component<IProps, IState> {
|
||||
return;
|
||||
}
|
||||
|
||||
this.initLogin();
|
||||
void this.initLogin();
|
||||
}
|
||||
|
||||
private onClearAll = (): void => {
|
||||
const { finished } = Modal.createDialog(ConfirmWipeDeviceDialog);
|
||||
finished.then(([wipeData]) => {
|
||||
void finished.then(([wipeData]) => {
|
||||
if (!wipeData) return;
|
||||
|
||||
logger.log("Clearing data from soft-logged-out session");
|
||||
Lifecycle.logout();
|
||||
return Lifecycle.logout();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ export const EnterEmail: React.FC<EnterEmailProps> = ({
|
||||
}
|
||||
|
||||
emailFieldRef.current?.focus();
|
||||
emailFieldRef.current?.validate({ allowEmpty: false, focused: true });
|
||||
void emailFieldRef.current?.validate({ allowEmpty: false, focused: true });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -211,7 +211,7 @@ export function useMemberListViewModel(roomId: string): MemberListViewState {
|
||||
|
||||
useTypedEventEmitter(cli, RoomStateEvent.Events, (event: MatrixEvent) => {
|
||||
if (event.getRoomId() === roomId && event.getType() === EventType.RoomThirdPartyInvite) {
|
||||
loadMembers();
|
||||
void loadMembers();
|
||||
const newCanInvite = getCanUserInviteToThisRoom();
|
||||
setCanInvite(newCanInvite);
|
||||
}
|
||||
@@ -219,7 +219,7 @@ export function useMemberListViewModel(roomId: string): MemberListViewState {
|
||||
|
||||
useTypedEventEmitter(cli, RoomStateEvent.Update, (state: RoomState) => {
|
||||
if (state.roomId === roomId) {
|
||||
loadMembers();
|
||||
void loadMembers();
|
||||
// Power level and join rule changes both surface here, and both can change whether we may
|
||||
// invite. Mirrors RoomSummaryCardViewModel, which recomputes canInviteTo on the same event.
|
||||
setCanInvite(getCanUserInviteToThisRoom());
|
||||
@@ -227,32 +227,32 @@ export function useMemberListViewModel(roomId: string): MemberListViewState {
|
||||
});
|
||||
|
||||
useTypedEventEmitter(cli, RoomMemberEvent.Name, (_: MatrixEvent, member: SdkRoomMember) => {
|
||||
if (member.roomId === roomId) loadMembers();
|
||||
if (member.roomId === roomId) void loadMembers();
|
||||
});
|
||||
|
||||
useTypedEventEmitter(cli, ClientEvent.Room, (room: Room) => {
|
||||
// We listen for room events because when we accept an invite
|
||||
// we need to wait till the room is fully populated with state
|
||||
// before refreshing the member list else we get a stale list.
|
||||
if (room.roomId === roomId) loadMembers();
|
||||
if (room.roomId === roomId) void loadMembers();
|
||||
});
|
||||
|
||||
useTypedEventEmitter(cli, RoomEvent.MyMembership, (room: Room, membership: string, oldMembership?: string) => {
|
||||
if (room.roomId !== roomId) return;
|
||||
if (membership === KnownMembership.Join && oldMembership !== KnownMembership.Join) {
|
||||
// we just joined the room, load the member list
|
||||
loadMembers();
|
||||
void loadMembers();
|
||||
const newShouldShowInvite = getShouldShowInvite();
|
||||
setShouldShowInvite(newShouldShowInvite);
|
||||
}
|
||||
});
|
||||
|
||||
useTypedEventEmitter(cli, UserEvent.Presence, (_: MatrixEvent | undefined, user: User) => {
|
||||
if (memberMap.has(user.userId)) loadMembers();
|
||||
if (memberMap.has(user.userId)) void loadMembers();
|
||||
});
|
||||
|
||||
useTypedEventEmitter(cli, UserEvent.CurrentlyActive, (_: MatrixEvent | undefined, user: User) => {
|
||||
if (memberMap.has(user.userId)) loadMembers();
|
||||
if (memberMap.has(user.userId)) void loadMembers();
|
||||
});
|
||||
|
||||
// Initial load of the memberlist
|
||||
|
||||
@@ -77,12 +77,12 @@ export function useMemberTileViewModel(props: MemberTileViewModelProps): MemberT
|
||||
|
||||
// The room is encrypted now.
|
||||
cli.removeListener(RoomStateEvent.Events, onRoomStateEvents);
|
||||
updateE2EStatus();
|
||||
void updateE2EStatus();
|
||||
};
|
||||
|
||||
const onUserTrustStatusChanged = (userId: string, trustStatus: UserVerificationStatus): void => {
|
||||
if (userId !== props.member.userId) return;
|
||||
updateE2EStatus();
|
||||
void updateE2EStatus();
|
||||
};
|
||||
|
||||
const { roomId } = props.member;
|
||||
@@ -90,7 +90,7 @@ export function useMemberTileViewModel(props: MemberTileViewModelProps): MemberT
|
||||
const isRoomEncrypted = cli.isRoomEncrypted(roomId);
|
||||
if (isRoomEncrypted) {
|
||||
cli.on(CryptoEvent.UserTrustStatusChanged, onUserTrustStatusChanged);
|
||||
updateE2EStatus();
|
||||
void updateE2EStatus();
|
||||
} else {
|
||||
// Listen for room to become encrypted
|
||||
cli.on(RoomStateEvent.Events, onRoomStateEvents);
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@ export const useUserInfoIgnoreButtonViewModel = (member: User | RoomMember): Use
|
||||
const ignoredUsers = cli.getIgnoredUsers();
|
||||
const index = ignoredUsers.indexOf(member.userId);
|
||||
if (index !== -1) ignoredUsers.splice(index, 1);
|
||||
cli.setIgnoredUsers(ignoredUsers);
|
||||
void cli.setIgnoredUsers(ignoredUsers);
|
||||
}, [cli, member]);
|
||||
|
||||
const ignore = useCallback(async () => {
|
||||
@@ -47,7 +47,7 @@ export const useUserInfoIgnoreButtonViewModel = (member: User | RoomMember): Use
|
||||
if (confirmed) {
|
||||
const ignoredUsers = cli.getIgnoredUsers();
|
||||
ignoredUsers.push(member.userId);
|
||||
cli.setIgnoredUsers(ignoredUsers);
|
||||
await cli.setIgnoredUsers(ignoredUsers);
|
||||
}
|
||||
}, [cli, member]);
|
||||
|
||||
@@ -74,7 +74,7 @@ export const useUserInfoIgnoreButtonViewModel = (member: User | RoomMember): Use
|
||||
if (isIgnored) {
|
||||
unignore();
|
||||
} else {
|
||||
ignore();
|
||||
void ignore();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ export default abstract class AudioPlayerBase<T extends IProps = IProps> extends
|
||||
|
||||
switch (action) {
|
||||
case KeyBindingAction.Space:
|
||||
this.playPauseRef.current?.toggleState();
|
||||
void this.playPauseRef.current?.toggleState();
|
||||
break;
|
||||
case KeyBindingAction.ArrowLeft:
|
||||
this.seekRef.current?.left();
|
||||
|
||||
@@ -72,21 +72,17 @@ export default class LegacySeekBar extends React.PureComponent<IProps, IState> {
|
||||
}
|
||||
|
||||
public left(): void {
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS);
|
||||
void this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS);
|
||||
}
|
||||
|
||||
public right(): void {
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS);
|
||||
void this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS);
|
||||
}
|
||||
|
||||
private onChange = (ev: ChangeEvent<HTMLInputElement>): void => {
|
||||
// Thankfully, onChange is only called when the user changes the value, not when we
|
||||
// change the value on the component. We can use this as a reliable "skip to X" function.
|
||||
//
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.props.playback.skipTo(Number(ev.target.value) * this.props.playback.durationSeconds);
|
||||
void this.props.playback.skipTo(Number(ev.target.value) * this.props.playback.durationSeconds);
|
||||
};
|
||||
|
||||
private onMouseDown = (event: React.MouseEvent): void => {
|
||||
|
||||
@@ -16,7 +16,7 @@ import LanguageDropdown from "../elements/LanguageDropdown";
|
||||
|
||||
function onChange(newLang: string): void {
|
||||
if (getCurrentLanguage() !== newLang) {
|
||||
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang);
|
||||
void SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang);
|
||||
PlatformPeg.get()?.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ export default class PasswordLogin extends React.PureComponent<IProps, IState> {
|
||||
// Focus the first invalid field and show feedback in the stricter mode
|
||||
// that no longer allows empty values for required fields.
|
||||
invalidField.focus();
|
||||
invalidField.validate({ allowEmpty: false, focused: true });
|
||||
void invalidField.validate({ allowEmpty: false, focused: true });
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
|
||||
if (this.state.email === "") {
|
||||
if (this.showEmail()) {
|
||||
const { finished } = Modal.createDialog(RegistrationEmailPromptDialog);
|
||||
finished.then(async ([confirmed, email]) => {
|
||||
await finished.then(async ([confirmed, email]) => {
|
||||
if (confirmed && email !== undefined) {
|
||||
this.setState({ email }, () => this.doSubmit(ev));
|
||||
}
|
||||
@@ -156,7 +156,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
|
||||
|
||||
if (promise) {
|
||||
ev.target.disabled = true;
|
||||
promise.finally(function () {
|
||||
void promise.finally(function () {
|
||||
ev.target.disabled = false;
|
||||
});
|
||||
}
|
||||
@@ -209,7 +209,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
|
||||
// Focus the first invalid field and show feedback in the stricter mode
|
||||
// that no longer allows empty values for required fields.
|
||||
invalidField.focus();
|
||||
invalidField.validate({ allowEmpty: false, focused: true });
|
||||
await invalidField.validate({ allowEmpty: false, focused: true });
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@ const DeviceContextMenuSection: React.FC<IDeviceContextMenuSectionProps> = ({ de
|
||||
const getDevices = async (): Promise<void> => {
|
||||
return setDevices((await MediaDeviceHandler.getDevices())?.[deviceKind] ?? []);
|
||||
};
|
||||
getDevices();
|
||||
void getDevices();
|
||||
}, [deviceKind]);
|
||||
|
||||
const onDeviceClick = (deviceId: string): void => {
|
||||
MediaDeviceHandler.instance.setDevice(deviceId, deviceKind);
|
||||
void MediaDeviceHandler.instance.setDevice(deviceId, deviceKind);
|
||||
setSelectedDevice(deviceId);
|
||||
};
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
||||
|
||||
private onResendReactionsClick = (): void => {
|
||||
for (const reaction of this.getUnsentReactions()) {
|
||||
Resend.resend(MatrixClientPeg.safeGet(), reaction);
|
||||
void Resend.resend(MatrixClientPeg.safeGet(), reaction);
|
||||
}
|
||||
this.closeMenu();
|
||||
};
|
||||
@@ -278,7 +278,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
||||
|
||||
private onPinClick = (isPinned: boolean): void => {
|
||||
// Pin or unpin in background
|
||||
PinningUtils.pinOrUnpinEvent(MatrixClientPeg.safeGet(), this.props.mxEvent);
|
||||
void PinningUtils.pinOrUnpinEvent(MatrixClientPeg.safeGet(), this.props.mxEvent);
|
||||
PosthogTrackers.trackPinUnpinMessage(isPinned ? "Pin" : "Unpin", "Timeline");
|
||||
|
||||
this.closeMenu();
|
||||
@@ -305,7 +305,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
||||
private onCopyLinkClick = (e: ButtonEvent): void => {
|
||||
e.preventDefault(); // So that we don't open the permalink
|
||||
if (!this.props.link) return;
|
||||
copyPlaintext(this.props.link);
|
||||
void copyPlaintext(this.props.link);
|
||||
this.closeMenu();
|
||||
};
|
||||
|
||||
@@ -315,7 +315,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
||||
};
|
||||
|
||||
private onCopyClick = (): void => {
|
||||
copyPlaintext(getSelectedText());
|
||||
void copyPlaintext(getSelectedText());
|
||||
this.closeMenu();
|
||||
};
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
||||
return (
|
||||
<IconizedContextMenuOption
|
||||
onClick={wrapHandler(() => {
|
||||
clearRoomNotification(room, cli);
|
||||
void clearRoomNotification(room, cli);
|
||||
onFinished?.();
|
||||
}, onPostMarkAsReadClick)}
|
||||
label={_t("room|context_menu|mark_read")}
|
||||
@@ -278,7 +278,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
||||
return (
|
||||
<IconizedContextMenuOption
|
||||
onClick={wrapHandler(() => {
|
||||
setMarkedUnreadState(room, cli, true);
|
||||
void setMarkedUnreadState(room, cli, true);
|
||||
onFinished?.();
|
||||
}, onPostMarkAsUnreadClick)}
|
||||
label={_t("room|context_menu|mark_unread")}
|
||||
|
||||
@@ -151,7 +151,7 @@ const SpaceContextMenu: React.FC<IProps> = ({ space, hideHeader, onFinished, ...
|
||||
ev.stopPropagation();
|
||||
|
||||
PosthogTrackers.trackInteraction("WebSpaceContextMenuNewRoomItem", ev);
|
||||
showCreateNewRoom(space);
|
||||
void showCreateNewRoom(space);
|
||||
onFinished();
|
||||
};
|
||||
|
||||
@@ -159,7 +159,7 @@ const SpaceContextMenu: React.FC<IProps> = ({ space, hideHeader, onFinished, ...
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
||||
showCreateNewRoom(space, elementCallVideoRoomsEnabled ? RoomType.UnstableCall : RoomType.ElementVideo);
|
||||
void showCreateNewRoom(space, elementCallVideoRoomsEnabled ? RoomType.UnstableCall : RoomType.ElementVideo);
|
||||
onFinished();
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function AskInviteAnywayDialog({
|
||||
}, [onInviteAnyways, onFinished]);
|
||||
|
||||
const onInviteNeverWarnClicked = useCallback((): void => {
|
||||
SettingsStore.setValue("promptBeforeInviteUnknownUsers", null, SettingLevel.ACCOUNT, false);
|
||||
void SettingsStore.setValue("promptBeforeInviteUnknownUsers", null, SettingLevel.ACCOUNT, false);
|
||||
onInviteAnyways();
|
||||
onFinished(true);
|
||||
}, [onInviteAnyways, onFinished]);
|
||||
|
||||
@@ -182,7 +182,7 @@ export default class BugReportDialog extends React.Component<BugReportDialogProp
|
||||
},
|
||||
);
|
||||
|
||||
sendSentryReport(this.state.text, this.state.issueUrl, this.props.error);
|
||||
void sendSentryReport(this.state.text, this.state.issueUrl, this.props.error);
|
||||
};
|
||||
|
||||
private onDownload = async (): Promise<void> => {
|
||||
|
||||
@@ -84,7 +84,7 @@ export default class ChangelogDialog extends React.Component<IProps, State> {
|
||||
const newCommits = parseVersion(this.props.newVersion)!;
|
||||
|
||||
for (const repo of REPOS) {
|
||||
this.fetchChanges(repo, commits[repo], newCommits[repo]);
|
||||
void this.fetchChanges(repo, commits[repo], newCommits[repo]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export function createRedactEventDialog({
|
||||
if (!roomId) throw new Error(`cannot redact event ${mxEvent.getId()} without room ID`);
|
||||
const { finished } = Modal.createDialog(ConfirmRedactDialog, { event: mxEvent }, "mx_Dialog_confirmredact");
|
||||
|
||||
finished.then(async ([proceed, reason]) => {
|
||||
void finished.then(async ([proceed, reason]) => {
|
||||
if (!proceed) return;
|
||||
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
|
||||
@@ -176,7 +176,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
||||
|
||||
public componentDidMount(): void {
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
checkUserIsAllowedToChangeEncryption(cli, Preset.PrivateChat).then(({ allowChange, forcedValue }) =>
|
||||
void checkUserIsAllowedToChangeEncryption(cli, Preset.PrivateChat).then(({ allowChange, forcedValue }) =>
|
||||
this.setState((state) => ({
|
||||
canChangeEncryption: allowChange,
|
||||
// override with forcedValue if it is set
|
||||
@@ -192,7 +192,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
||||
const action = getKeyBindingsManager().getAccessibilityAction(event);
|
||||
switch (action) {
|
||||
case KeyBindingAction.Enter:
|
||||
this.onOk();
|
||||
void this.onOk();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
|
||||
@@ -53,7 +53,7 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick
|
||||
// require & validate the space name field
|
||||
if (spaceNameField.current && !(await spaceNameField.current.validate({ allowEmpty: false }))) {
|
||||
spaceNameField.current.focus();
|
||||
spaceNameField.current.validate({ allowEmpty: false, focused: true });
|
||||
void spaceNameField.current.validate({ allowEmpty: false, focused: true });
|
||||
setBusy(false);
|
||||
return;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick
|
||||
!(await spaceAliasField.current.validate({ allowEmpty: true }))
|
||||
) {
|
||||
spaceAliasField.current.focus();
|
||||
spaceAliasField.current.validate({ allowEmpty: true, focused: true });
|
||||
void spaceAliasField.current.validate({ allowEmpty: true, focused: true });
|
||||
setBusy(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -141,13 +141,13 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
}));
|
||||
|
||||
if (!isValidSize) {
|
||||
sizeLimitRef.current?.validate({ focused: true });
|
||||
void sizeLimitRef.current?.validate({ focused: true });
|
||||
return;
|
||||
}
|
||||
if (exportType === ExportType.LastNMessages) {
|
||||
const isValidNumberOfMessages = await messageCountRef.current?.validate({ focused: false });
|
||||
if (!isValidNumberOfMessages) {
|
||||
messageCountRef.current?.validate({ focused: true });
|
||||
void messageCountRef.current?.validate({ focused: true });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
||||
if (hasFeedback && sendFeedback) {
|
||||
const label = props.feature ? `${props.feature}-feedback` : "feedback";
|
||||
// TODO: Handle rejection.
|
||||
submitFeedback(label, comment, canContact);
|
||||
void submitFeedback(label, comment, canContact);
|
||||
|
||||
Modal.createDialog(InfoDialog, {
|
||||
title: _t("feedback|sent"),
|
||||
|
||||
@@ -253,7 +253,7 @@ const ForwardDialog: React.FC<IProps> = ({ matrixClient: cli, event, permalinkCr
|
||||
const userId = cli.getSafeUserId();
|
||||
const [profileInfo, setProfileInfo] = useState<any>({});
|
||||
useEffect(() => {
|
||||
cli.getProfileInfo(userId).then((info) => setProfileInfo(info));
|
||||
void cli.getProfileInfo(userId).then((info) => setProfileInfo(info));
|
||||
}, [cli, userId]);
|
||||
|
||||
const { type, content } = transformEvent(event, cli);
|
||||
|
||||
@@ -39,7 +39,7 @@ const GenericFeatureFeedbackDialog: React.FC<IProps> = ({
|
||||
const sendFeedback = async (ok: boolean): Promise<void> => {
|
||||
if (!ok) return onFinished(false);
|
||||
// TODO: Handle rejection.
|
||||
submitFeedback(rageshakeLabel, comment, canContact, rageshakeData);
|
||||
void submitFeedback(rageshakeLabel, comment, canContact, rageshakeData);
|
||||
onFinished(true);
|
||||
|
||||
Modal.createDialog(InfoDialog, {
|
||||
|
||||
@@ -67,7 +67,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
||||
public componentDidMount(): void {
|
||||
this.props.verifier.on(VerifierEvent.ShowSas, this.onVerifierShowSas);
|
||||
this.props.verifier.on(VerifierEvent.Cancel, this.onVerifierCancel);
|
||||
this.fetchOpponentProfile();
|
||||
void this.fetchOpponentProfile();
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
@@ -125,7 +125,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
||||
};
|
||||
|
||||
private onSasMatchesClick = (): void => {
|
||||
this.showSasEvent?.confirm();
|
||||
void this.showSasEvent?.confirm();
|
||||
this.setState({
|
||||
phase: PHASE_WAIT_FOR_PARTNER_TO_CONFIRM,
|
||||
});
|
||||
|
||||
@@ -249,7 +249,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
||||
this.encryptionByDefault = privateShouldBeEncrypted(MatrixClientPeg.safeGet());
|
||||
|
||||
if (this.props.initialText) {
|
||||
this.updateSuggestions(this.props.initialText);
|
||||
void this.updateSuggestions(this.props.initialText);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,13 +482,13 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
||||
return;
|
||||
}
|
||||
|
||||
SDKContextClass.instance.legacyCallHandler.startTransferToMatrixID(
|
||||
await SDKContextClass.instance.legacyCallHandler.startTransferToMatrixID(
|
||||
this.props.call,
|
||||
targetIds[0],
|
||||
this.state.consultFirst,
|
||||
);
|
||||
} else {
|
||||
SDKContextClass.instance.legacyCallHandler.startTransferToPhoneNumber(
|
||||
await SDKContextClass.instance.legacyCallHandler.startTransferToPhoneNumber(
|
||||
this.props.call,
|
||||
this.state.dialPadValue,
|
||||
this.state.consultFirst,
|
||||
@@ -650,7 +650,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
||||
private updateFilter = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
||||
const term = e.target.value;
|
||||
this.setState({ filterText: term });
|
||||
this.updateSuggestions(term);
|
||||
void this.updateSuggestions(term);
|
||||
};
|
||||
|
||||
private showMoreRecents = (): void => {
|
||||
@@ -1001,7 +1001,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
||||
|
||||
private onDialFormSubmit = (ev: SyntheticEvent): void => {
|
||||
ev.preventDefault();
|
||||
this.transferCall();
|
||||
void this.transferCall();
|
||||
};
|
||||
|
||||
private onDialChange = (ev: React.ChangeEvent<HTMLInputElement>): void => {
|
||||
|
||||
@@ -119,7 +119,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.loadMoreEdits();
|
||||
void this.loadMoreEdits();
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
|
||||
@@ -92,7 +92,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
|
||||
this.themeWatcher.on(ThemeWatcherEvent.Change, this.onThemeChange);
|
||||
// Theme may have changed while messaging was starting
|
||||
this.onThemeChange(this.themeWatcher.getEffectiveTheme());
|
||||
this.state.messaging?.sendWidgetConfig(this.props.widgetDefinition);
|
||||
void this.state.messaging?.sendWidgetConfig(this.props.widgetDefinition);
|
||||
};
|
||||
|
||||
private onLoad = (): void => {
|
||||
@@ -103,7 +103,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
|
||||
};
|
||||
|
||||
private onThemeChange = (theme: string): void => {
|
||||
this.state.messaging?.updateTheme({ name: theme });
|
||||
void this.state.messaging?.updateTheme({ name: theme });
|
||||
};
|
||||
|
||||
private onWidgetClose = (ev: CustomEvent<IModalWidgetCloseRequest>): void => {
|
||||
@@ -177,7 +177,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
|
||||
}
|
||||
|
||||
const onClick = (): void => {
|
||||
this.state.messaging?.notifyModalWidgetButtonClicked(def.id);
|
||||
void this.state.messaging?.notifyModalWidgetButtonClicked(def.id);
|
||||
};
|
||||
|
||||
const isDisabled = this.state.disabledButtonIds.includes(def.id);
|
||||
|
||||
@@ -31,7 +31,7 @@ const RegistrationEmailPromptDialog: React.FC<IProps> = ({ onFinished }) => {
|
||||
|
||||
if (!valid) {
|
||||
fieldRef.current.focus();
|
||||
fieldRef.current.validate({ focused: true });
|
||||
void fieldRef.current.validate({ focused: true });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ export default class ServerPickerDialog extends React.PureComponent<IProps, ISta
|
||||
|
||||
if (!valid) {
|
||||
this.fieldRef.current?.focus();
|
||||
this.fieldRef.current?.validate({ allowEmpty: false, focused: true });
|
||||
void this.fieldRef.current?.validate({ allowEmpty: false, focused: true });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class SessionRestoreErrorDialog extends React.Component<IProps> {
|
||||
button: _t("action|sign_out"),
|
||||
danger: true,
|
||||
});
|
||||
finished.then(([ok]) => this.props.onFinished(ok));
|
||||
void finished.then(([ok]) => this.props.onFinished(ok));
|
||||
};
|
||||
|
||||
private onRefreshClick = (): void => {
|
||||
|
||||
@@ -71,7 +71,7 @@ export default class SetEmailDialog extends React.Component<IProps, IState> {
|
||||
description: _t("auth|set_email|verification_pending_description"),
|
||||
button: _t("action|continue"),
|
||||
});
|
||||
finished.then(([ok]) => this.onEmailDialogFinished(ok));
|
||||
void finished.then(([ok]) => this.onEmailDialogFinished(ok));
|
||||
},
|
||||
(err) => {
|
||||
this.setState({ emailBusy: false });
|
||||
@@ -120,7 +120,7 @@ export default class SetEmailDialog extends React.Component<IProps, IState> {
|
||||
description: message,
|
||||
button: _t("action|continue"),
|
||||
});
|
||||
finished.then(([ok]) => this.onEmailDialogFinished(ok));
|
||||
void finished.then(([ok]) => this.onEmailDialogFinished(ok));
|
||||
} else {
|
||||
logger.error("Unable to verify email address: " + err);
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
|
||||
@@ -39,7 +39,7 @@ const SpacePreferencesAppearanceTab: React.FC<Pick<IProps, "space">> = ({ space
|
||||
<StyledCheckbox
|
||||
checked={!!showPeople}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
SettingsStore.setValue(
|
||||
void SettingsStore.setValue(
|
||||
"Spaces.showPeopleInSpace",
|
||||
space.roomId,
|
||||
SettingLevel.ROOM_ACCOUNT,
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class TextInputDialog extends React.Component<IProps, IState> {
|
||||
|
||||
if (!this.field.current.state.valid) {
|
||||
this.field.current.focus();
|
||||
this.field.current.validate({ allowEmpty: false, focused: true });
|
||||
void this.field.current.validate({ allowEmpty: false, focused: true });
|
||||
this.setState({ busy: false });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export default class VerificationRequestDialog extends React.Component<IProps, I
|
||||
// phase up-to-date.
|
||||
this.state.verificationRequest?.on(VerificationRequestEvent.Change, this.onRequestChange);
|
||||
|
||||
this.props.verificationRequestPromise?.then((r) => {
|
||||
void this.props.verificationRequestPromise?.then((r) => {
|
||||
// The request promise completed, so we have a new request
|
||||
|
||||
// Stop listening to the old request (if we have one, which normally we won't)
|
||||
|
||||
@@ -54,7 +54,7 @@ const BaseTool: React.FC<XOR<IMinProps, IProps>> = ({
|
||||
children = message;
|
||||
} else if (onAction && actionLabel) {
|
||||
const onActionClick = (): void => {
|
||||
onAction().then((msg) => {
|
||||
void onAction().then((msg) => {
|
||||
if (typeof msg === "string") {
|
||||
setMessage(msg);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export const EventEditor: React.FC<IEventEditorProps> = ({ fieldDefs, defaultCon
|
||||
|
||||
if (!valid) {
|
||||
contentField.current?.focus();
|
||||
contentField.current?.validate({ focused: true });
|
||||
void contentField.current?.validate({ focused: true });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
||||
// We don't use Field's validation here because we want it in a separate place rather
|
||||
// than in a tooltip. Ideally we would refactor Field's validation logic so we could
|
||||
// re-use some of it.
|
||||
this.validateRecoveryKeyOnChange();
|
||||
void this.validateRecoveryKeyOnChange();
|
||||
};
|
||||
|
||||
private onRecoveryKeyNext = async (ev: FormEvent<HTMLFormElement> | React.MouseEvent): Promise<void> => {
|
||||
|
||||
@@ -84,7 +84,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.loadBackupStatus();
|
||||
void this.loadBackupStatus();
|
||||
}
|
||||
|
||||
private onCancel = (): void => {
|
||||
@@ -109,7 +109,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
||||
|
||||
private onResetRecoveryClick = (): void => {
|
||||
this.props.onFinished(false);
|
||||
accessSecretStorage(async (): Promise<void> => {}, { forceReset: true });
|
||||
void accessSecretStorage(async (): Promise<void> => {}, { forceReset: true });
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -343,7 +343,8 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
||||
|
||||
const [supportsSpaceFiltering, setSupportsSpaceFiltering] = useState(true); // assume it does until we find out it doesn't
|
||||
useEffect(() => {
|
||||
cli.isVersionSupported("v1.4")
|
||||
void cli
|
||||
.isVersionSupported("v1.4")
|
||||
.then((supported) => {
|
||||
return supported || cli.doesServerSupportUnstableFeature("org.matrix.msc3827.stable");
|
||||
})
|
||||
@@ -559,7 +560,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
||||
recents.delete(room.roomId);
|
||||
recents.add(room.roomId);
|
||||
|
||||
SettingsStore.setValue(
|
||||
void SettingsStore.setValue(
|
||||
"SpotlightSearch.recentSearches",
|
||||
null,
|
||||
SettingLevel.ACCOUNT,
|
||||
@@ -685,7 +686,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
||||
id={`mx_SpotlightDialog_button_result_${result.member.userId}`}
|
||||
key={`${Section[result.section]}-${result.member.userId}`}
|
||||
onClick={() => {
|
||||
startDmOnFirstMessage(cli, [result.member]);
|
||||
void startDmOnFirstMessage(cli, [result.member]);
|
||||
onFinished();
|
||||
}}
|
||||
aria-label={
|
||||
@@ -978,7 +979,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
||||
className="mx_SpotlightDialog_inviteLink"
|
||||
onClick={() => {
|
||||
setInviteLinkCopied(true);
|
||||
copyPlaintext(ownInviteLink);
|
||||
void copyPlaintext(ownInviteLink);
|
||||
}}
|
||||
onTooltipOpenChange={(open) => {
|
||||
if (!open) setInviteLinkCopied(false);
|
||||
|
||||
@@ -96,7 +96,7 @@ function useSettingsValueWithSetter<S extends SettingKey>(
|
||||
const setter = useCallback(
|
||||
async (value: Settings[S]["default"]): Promise<void> => {
|
||||
setValue(value);
|
||||
SettingsStore.setValue(settingName, roomId, level, value);
|
||||
await SettingsStore.setValue(settingName, roomId, level, value);
|
||||
},
|
||||
[level, roomId, settingName],
|
||||
);
|
||||
|
||||
@@ -319,7 +319,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private onAllowedWidgetsChange = (): void => {
|
||||
this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => {
|
||||
void this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => {
|
||||
if (this.unmounted) return;
|
||||
|
||||
if (this.state.hasPermissionToLoad && !hasPermissionToLoad) {
|
||||
@@ -378,7 +378,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||
// Sync check already approved — start immediately, no need to re-check.
|
||||
this.startWidget();
|
||||
} else {
|
||||
this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => {
|
||||
void this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => {
|
||||
if (this.unmounted) return;
|
||||
this.setState({ hasPermissionToLoad });
|
||||
if (hasPermissionToLoad) {
|
||||
@@ -469,7 +469,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private startWidget(): void {
|
||||
this.messaging?.prepare().then(() => {
|
||||
void this.messaging?.prepare().then(() => {
|
||||
if (this.unmounted) return;
|
||||
this.setState({ initialising: false });
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ const EffectsOverlay: FunctionComponent<IProps> = ({ roomWidth }) => {
|
||||
const isOutdated = isEventOutdated(payload.event);
|
||||
if (canvasRef.current && payload.action.startsWith(actionPrefix) && !isOutdated) {
|
||||
const effect = payload.action.slice(actionPrefix.length);
|
||||
lazyLoadEffectModule(effect).then((module) => module?.start(canvasRef.current!));
|
||||
void lazyLoadEffectModule(effect).then((module) => module?.start(canvasRef.current!));
|
||||
}
|
||||
};
|
||||
const dispatcherRef = dis.register(onAction);
|
||||
@@ -64,7 +64,7 @@ const EffectsOverlay: FunctionComponent<IProps> = ({ roomWidth }) => {
|
||||
for (const effect in currentEffects) {
|
||||
const effectModule: ICanvasEffect = currentEffects.get(effect)!;
|
||||
if (effectModule && effectModule.isRunning) {
|
||||
effectModule.stop();
|
||||
void effectModule.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ export default class ErrorBoundary extends React.PureComponent<Props, IState> {
|
||||
if (!PlatformPeg.get()) return;
|
||||
|
||||
MatrixClientPeg.safeGet().stopClient();
|
||||
MatrixClientPeg.safeGet()
|
||||
void MatrixClientPeg.safeGet()
|
||||
.store.deleteAllData()
|
||||
.then(() => {
|
||||
PlatformPeg.get()?.reload();
|
||||
|
||||
@@ -152,7 +152,7 @@ export default class Field extends React.PureComponent<PropShapes, IState> {
|
||||
* fields, in which case we can add some options to control it.
|
||||
*/
|
||||
private validateOnChange = debounce(() => {
|
||||
this.validate({
|
||||
void this.validate({
|
||||
focused: true,
|
||||
});
|
||||
}, VALIDATION_THROTTLE_MS);
|
||||
@@ -180,7 +180,7 @@ export default class Field extends React.PureComponent<PropShapes, IState> {
|
||||
focused: true,
|
||||
});
|
||||
if (this.props.validateOnFocus) {
|
||||
this.validate({
|
||||
void this.validate({
|
||||
focused: true,
|
||||
});
|
||||
}
|
||||
@@ -201,7 +201,7 @@ export default class Field extends React.PureComponent<PropShapes, IState> {
|
||||
focused: false,
|
||||
});
|
||||
if (this.props.validateOnBlur) {
|
||||
this.validate({
|
||||
void this.validate({
|
||||
focused: false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class IRCTimelineProfileResizer extends React.Component<IProps, I
|
||||
|
||||
private onMoueUp = (): void => {
|
||||
if (this.props.roomId) {
|
||||
SettingsStore.setValue(
|
||||
void SettingsStore.setValue(
|
||||
"ircDisplayNameWidth",
|
||||
this.props.roomId,
|
||||
SettingLevel.ROOM_DEVICE,
|
||||
|
||||
@@ -315,7 +315,7 @@ export default class ImageView extends React.Component<IProps, IState> {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
if (this.downloadFunction) {
|
||||
this.downloadFunction();
|
||||
void this.downloadFunction();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
|
||||
button: _t("action|try_again"),
|
||||
cancelButton: _t("action|cancel"),
|
||||
});
|
||||
finished.then(([tryAgain]) => {
|
||||
void finished.then(([tryAgain]) => {
|
||||
if (!tryAgain) {
|
||||
this.cancel();
|
||||
} else {
|
||||
|
||||
@@ -31,7 +31,7 @@ const QRCode: React.FC<IProps> = ({ data, className, ...options }) => {
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
toDataURL(data, { ...defaultOptions, ...options }).then((uri) => {
|
||||
void toDataURL(data, { ...defaultOptions, ...options }).then((uri) => {
|
||||
if (cancelled) return;
|
||||
setUri(uri);
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ export default class ReplyChain extends React.Component<IProps, IState> {
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.unmounted = false;
|
||||
this.initialize();
|
||||
void this.initialize();
|
||||
this.trySetExpandableQuotes();
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ export default class ReplyChain extends React.Component<IProps, IState> {
|
||||
};
|
||||
|
||||
public collapse = (): void => {
|
||||
this.initialize();
|
||||
void this.initialize();
|
||||
};
|
||||
|
||||
private onQuoteClick = async (): Promise<void> => {
|
||||
|
||||
@@ -32,7 +32,7 @@ const showPickerDialog = (
|
||||
onFinished: (config?: ValidatedServerConfig) => void,
|
||||
): void => {
|
||||
const { finished } = Modal.createDialog(ServerPickerDialog, { title, serverConfig });
|
||||
finished.then(([config]) => onFinished(config));
|
||||
void finished.then(([config]) => onFinished(config));
|
||||
};
|
||||
|
||||
const onHelpClick = (): void => {
|
||||
|
||||
@@ -41,7 +41,7 @@ const SettingsDropdown = ({
|
||||
const onOptionChange = useCallback(
|
||||
(value: string): void => {
|
||||
setValue(value); // local echo
|
||||
SettingsStore.setValue(settingKey, roomId ?? null, level, value);
|
||||
void SettingsStore.setValue(settingKey, roomId ?? null, level, value);
|
||||
onChange?.(value);
|
||||
},
|
||||
[settingKey, roomId, level, onChange],
|
||||
|
||||
@@ -92,7 +92,7 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
||||
if (myReactions.hasOwnProperty(reaction)) {
|
||||
if (this.props.mxEvent.isRedacted() || !this.context.canSelfRedact) return false;
|
||||
|
||||
MatrixClientPeg.safeGet().redactEvent(this.props.mxEvent.getRoomId()!, myReactions[reaction]);
|
||||
void MatrixClientPeg.safeGet().redactEvent(this.props.mxEvent.getRoomId()!, myReactions[reaction]);
|
||||
dis.dispatch<FocusComposerPayload>({
|
||||
action: Action.FocusAComposer,
|
||||
context: this.context.timelineRenderingType,
|
||||
@@ -100,7 +100,7 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
||||
// Tell the emoji picker not to bump this in the more frequently used list.
|
||||
return false;
|
||||
} else {
|
||||
MatrixClientPeg.safeGet().sendEvent(this.props.mxEvent.getRoomId()!, EventType.Reaction, {
|
||||
void MatrixClientPeg.safeGet().sendEvent(this.props.mxEvent.getRoomId()!, EventType.Reaction, {
|
||||
"m.relates_to": {
|
||||
rel_type: RelationType.Annotation,
|
||||
event_id: this.props.mxEvent.getId()!,
|
||||
|
||||
@@ -191,7 +191,7 @@ class LocationPicker extends React.Component<ILocationPickerProps, IState> {
|
||||
private onOk = (): void => {
|
||||
const { timeout, position } = this.state;
|
||||
|
||||
this.props.onChoose(
|
||||
void this.props.onChoose(
|
||||
position
|
||||
? { uri: getGeoUri(position), timestamp: position.timestamp, timeout }
|
||||
: {
|
||||
|
||||
@@ -63,7 +63,7 @@ const LocationShareMenu: React.FC<Props> = ({ menuPosition, onFinished, sender,
|
||||
: shareLocation(matrixClient, roomId, shareType ?? LocationShareType.Own, relation, openMenu);
|
||||
|
||||
const onLiveShareEnableSubmit = (): void => {
|
||||
SettingsStore.setValue("feature_location_share_live", null, SettingLevel.DEVICE, true);
|
||||
void SettingsStore.setValue("feature_location_share_live", null, SettingLevel.DEVICE, true);
|
||||
};
|
||||
|
||||
const shouldAdvertiseLiveLabsFlag = shareType === LocationShareType.Live && !isLiveShareEnabled;
|
||||
|
||||
@@ -114,7 +114,7 @@ const ActiveLoadedCallEvent = ({ mxEvent, call, ref }: ActiveLoadedCallEventProp
|
||||
const disconnect = useCallback(
|
||||
(ev: ButtonEvent) => {
|
||||
ev.preventDefault();
|
||||
call.disconnect();
|
||||
void call.disconnect();
|
||||
},
|
||||
[call],
|
||||
);
|
||||
|
||||
@@ -114,7 +114,7 @@ const CodeBlock: React.FC<Props> = ({ preNode }) => {
|
||||
}
|
||||
|
||||
function highlightCodeRef(div: HTMLElement | null): void {
|
||||
highlightCode(div);
|
||||
void highlightCode(div);
|
||||
}
|
||||
|
||||
let content = domToReact(preNode.children as DOMNode[]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user