From eadc43ddf48dd4f7a75b3356279c77224b024820 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 13 Aug 2026 10:24:13 +0000 Subject: [PATCH] Enable oxlint rule `typescript/no-floating-promises` (#34586) * Enable oxlint rule `typescript/no-floating-promises` * Iterate --- apps/desktop/src/updater.ts | 4 +- apps/web/res/decoder-ring/decoder.js | 6 +-- apps/web/src/ContentMessages.ts | 2 +- apps/web/src/LegacyCallHandler.tsx | 32 ++++++------- apps/web/src/Lifecycle.ts | 18 ++++---- apps/web/src/MatrixClientPeg.ts | 4 +- apps/web/src/MediaDeviceHandler.ts | 10 ++-- apps/web/src/Modal.tsx | 8 ++-- apps/web/src/Notifier.ts | 10 ++-- apps/web/src/PosthogAnalytics.ts | 2 +- apps/web/src/Presence.ts | 4 +- apps/web/src/Registration.tsx | 2 +- apps/web/src/ScalarMessaging.ts | 10 ++-- apps/web/src/SlidingSyncManager.ts | 2 +- apps/web/src/UserActivity.ts | 4 +- .../eventindex/ManageEventIndexDialog.tsx | 2 +- .../security/CreateSecretStorageDialog.tsx | 8 ++-- .../dialogs/security/ExportE2eKeysDialog.tsx | 2 +- .../dialogs/security/ImportE2eKeysDialog.tsx | 3 +- .../security/NewRecoveryMethodDialog.tsx | 4 +- apps/web/src/audio/BackgroundAudio.ts | 2 +- apps/web/src/audio/Playback.ts | 3 +- apps/web/src/audio/PlaybackQueue.ts | 9 ++-- apps/web/src/audio/VoiceRecording.ts | 11 ++--- .../components/structures/EmbeddedPage.tsx | 2 +- .../src/components/structures/FilePanel.tsx | 2 +- .../components/structures/InteractiveAuth.tsx | 4 +- .../structures/LegacyCallEventGrouper.ts | 5 +- .../components/structures/LoggedInView.tsx | 16 +++---- .../src/components/structures/MatrixChat.tsx | 46 +++++++++---------- .../src/components/structures/RightPanel.tsx | 2 +- .../components/structures/RoomSearchView.tsx | 2 +- .../src/components/structures/RoomView.tsx | 40 ++++++++-------- .../src/components/structures/ScrollPanel.tsx | 12 ++--- .../components/structures/SpaceRoomView.tsx | 2 +- .../src/components/structures/ThreadPanel.tsx | 3 +- .../src/components/structures/ThreadView.tsx | 2 +- .../components/structures/TimelinePanel.tsx | 16 +++---- .../src/components/structures/UserView.tsx | 4 +- .../structures/auth/ForgotPassword.tsx | 10 ++-- .../src/components/structures/auth/Login.tsx | 4 +- .../structures/auth/Registration.tsx | 10 ++-- .../structures/auth/SetupEncryptionBody.tsx | 6 +-- .../components/structures/auth/SoftLogout.tsx | 6 +-- .../auth/forgot-password/EnterEmail.tsx | 2 +- .../memberlist/MemberListViewModel.ts | 14 +++--- .../memberlist/tiles/MemberTileViewModel.ts | 6 +-- .../UserInfoIgnoreButtonViewModel.tsx | 6 +-- .../views/audio_messages/AudioPlayerBase.tsx | 2 +- .../views/audio_messages/LegacySeekBar.tsx | 10 ++-- .../views/auth/LanguageSelector.tsx | 2 +- .../components/views/auth/PasswordLogin.tsx | 2 +- .../views/auth/RegistrationForm.tsx | 6 +-- .../views/context_menus/DeviceContextMenu.tsx | 4 +- .../context_menus/MessageContextMenu.tsx | 8 ++-- .../context_menus/RoomGeneralContextMenu.tsx | 4 +- .../views/context_menus/SpaceContextMenu.tsx | 4 +- .../views/dialogs/AskInviteAnywayDialog.tsx | 2 +- .../views/dialogs/BugReportDialog.tsx | 2 +- .../views/dialogs/ChangelogDialog.tsx | 2 +- .../views/dialogs/ConfirmRedactDialog.tsx | 2 +- .../views/dialogs/CreateRoomDialog.tsx | 4 +- .../views/dialogs/CreateSubspaceDialog.tsx | 4 +- .../components/views/dialogs/ExportDialog.tsx | 4 +- .../views/dialogs/FeedbackDialog.tsx | 2 +- .../views/dialogs/ForwardDialog.tsx | 2 +- .../dialogs/GenericFeatureFeedbackDialog.tsx | 2 +- .../views/dialogs/IncomingSasDialog.tsx | 4 +- .../components/views/dialogs/InviteDialog.tsx | 10 ++-- .../dialogs/MessageEditHistoryDialog.tsx | 2 +- .../views/dialogs/ModalWidgetDialog.tsx | 6 +-- .../dialogs/RegistrationEmailPromptDialog.tsx | 2 +- .../views/dialogs/ServerPickerDialog.tsx | 2 +- .../dialogs/SessionRestoreErrorDialog.tsx | 2 +- .../views/dialogs/SetEmailDialog.tsx | 4 +- .../views/dialogs/SpacePreferencesDialog.tsx | 2 +- .../views/dialogs/TextInputDialog.tsx | 2 +- .../dialogs/VerificationRequestDialog.tsx | 2 +- .../views/dialogs/devtools/BaseTool.tsx | 2 +- .../views/dialogs/devtools/Event.tsx | 2 +- .../security/AccessSecretStorageDialog.tsx | 2 +- .../security/RestoreKeyBackupDialog.tsx | 4 +- .../dialogs/spotlight/SpotlightDialog.tsx | 9 ++-- .../views/directory/NetworkDropdown.tsx | 2 +- .../src/components/views/elements/AppTile.tsx | 6 +-- .../views/elements/EffectsOverlay.tsx | 4 +- .../views/elements/ErrorBoundary.tsx | 2 +- .../src/components/views/elements/Field.tsx | 6 +-- .../elements/IRCTimelineProfileResizer.tsx | 2 +- .../components/views/elements/ImageView.tsx | 2 +- .../views/elements/PollCreateDialog.tsx | 2 +- .../src/components/views/elements/QRCode.tsx | 2 +- .../components/views/elements/ReplyChain.tsx | 4 +- .../views/elements/ServerPicker.tsx | 2 +- .../views/elements/SettingsDropdown.tsx | 2 +- .../views/emojipicker/ReactionPicker.tsx | 4 +- .../views/location/LocationPicker.tsx | 2 +- .../views/location/LocationShareMenu.tsx | 2 +- .../components/views/messages/CallEvent.tsx | 2 +- .../components/views/messages/CodeBlock.tsx | 2 +- .../components/views/messages/MBeaconBody.tsx | 2 +- .../components/views/messages/MPollBody.tsx | 2 +- .../polls/pollHistory/PollListItemEnded.tsx | 2 +- .../views/polls/pollHistory/fetchPastPolls.ts | 4 +- .../views/polls/pollHistory/usePollHistory.ts | 2 +- .../views/right_panel/EncryptionPanel.tsx | 2 +- .../views/right_panel/ExtensionsCard.tsx | 3 +- .../views/right_panel/PinnedMessagesCard.tsx | 2 +- .../components/views/right_panel/UserInfo.tsx | 6 +-- .../views/right_panel/VerificationPanel.tsx | 6 +-- .../user_info/UserInfoAdminToolsContainer.tsx | 6 +-- .../user_info/UserInfoBasicOptionsView.tsx | 2 +- .../views/room_settings/AliasSettings.tsx | 6 +-- .../room_settings/RoomPublishSetting.tsx | 2 +- .../components/views/rooms/Autocomplete.tsx | 4 +- .../views/rooms/BasicMessageComposer.tsx | 14 +++--- .../views/rooms/EditMessageComposer.tsx | 4 +- .../src/components/views/rooms/EventTile.tsx | 2 +- .../views/rooms/MessageComposer.tsx | 12 ++--- .../rooms/RoomHeader/CallGuestLinkButton.tsx | 2 +- .../components/views/rooms/RoomPreviewBar.tsx | 4 +- .../views/rooms/SendMessageComposer.tsx | 10 ++-- .../components/views/rooms/Stickerpicker.tsx | 3 +- .../views/rooms/VoiceRecordComposerTile.tsx | 8 ++-- .../hooks/useComposerFunctions.ts | 2 +- .../hooks/useWysiwygEditActionHandler.ts | 4 +- .../hooks/useWysiwygSendActionHandler.ts | 4 +- .../rooms/wysiwyg_composer/utils/message.ts | 2 +- .../views/settings/AddRemoveThreepids.tsx | 4 +- .../views/settings/EventIndexPanel.tsx | 4 +- .../views/settings/ImageSizePanel.tsx | 3 +- .../views/settings/JoinRuleSettings.tsx | 2 +- .../views/settings/LayoutSwitcher.tsx | 2 +- .../views/settings/Notifications.tsx | 7 ++- .../components/views/settings/SetIdServer.tsx | 4 +- .../settings/UserPersonalInfoSettings.tsx | 2 +- .../views/settings/devices/deleteDevices.ts | 2 +- .../views/settings/devices/useOwnDevices.ts | 6 +-- .../settings/discovery/DiscoverySettings.tsx | 2 +- .../settings/encryption/ChangeRecoveryKey.tsx | 2 +- .../settings/encryption/KeyStoragePanel.tsx | 2 +- .../tabs/room/AdvancedRoomSettingsTab.tsx | 2 +- .../tabs/room/NotificationSettingsTab.tsx | 2 +- .../tabs/room/SecurityRoomSettingsTab.tsx | 6 +-- .../tabs/room/VoipRoomSettingsTab.tsx | 2 +- .../tabs/user/AccountUserSettingsTab.tsx | 2 +- .../tabs/user/AppearanceUserSettingsTab.tsx | 2 +- .../tabs/user/EncryptionUserSettingsTab.tsx | 2 +- .../tabs/user/HelpUserSettingsTab.tsx | 2 +- .../tabs/user/MediaPreviewAccountSettings.tsx | 2 +- .../tabs/user/PreferencesUserSettingsTab.tsx | 15 ++++-- .../tabs/user/SecurityUserSettingsTab.tsx | 6 +-- .../settings/tabs/user/SessionManagerTab.tsx | 8 ++-- .../views/spaces/SpaceCreateMenu.tsx | 9 ++-- .../components/views/spaces/SpacePanel.tsx | 7 ++- .../views/toasts/VerificationRequestToast.tsx | 4 +- .../src/components/views/voip/AudioFeed.tsx | 6 +-- .../src/components/views/voip/CallView.tsx | 2 +- .../components/views/voip/DialPadModal.tsx | 4 +- .../components/views/voip/LegacyCallView.tsx | 10 ++-- .../src/components/views/voip/VideoFeed.tsx | 8 ++-- apps/web/src/contexts/SDKContextClass.ts | 4 +- .../web/src/device-listener/DeviceListener.ts | 6 +-- .../DeviceListenerOtherDevices.ts | 2 +- apps/web/src/editor/operations.ts | 6 +-- apps/web/src/emojipicker/recent.ts | 7 ++- apps/web/src/hooks/room/useRoomCall.ts | 4 +- .../src/hooks/spotlight/useRecentSearches.ts | 2 +- apps/web/src/hooks/useAsyncMemo.ts | 2 +- apps/web/src/hooks/useEncryptionStatus.ts | 2 +- apps/web/src/hooks/useEventEmitter.ts | 2 +- apps/web/src/hooks/usePermalinkEvent.ts | 2 +- apps/web/src/hooks/usePermalinkMember.ts | 2 +- apps/web/src/hooks/usePublicRoomDirectory.ts | 2 +- apps/web/src/hooks/useSpaceResults.ts | 2 +- apps/web/src/indexing/EventIndex.ts | 4 +- apps/web/src/modules/ProxiedModuleApi.ts | 2 +- apps/web/src/rageshake/rageshake.ts | 4 +- apps/web/src/sendTimePerformanceMetrics.ts | 3 +- apps/web/src/settings/SettingsStore.ts | 4 +- .../InviteRulesConfigController.ts | 2 +- .../handlers/AccountSettingsHandler.ts | 2 +- .../handlers/PlatformSettingsHandler.ts | 2 +- apps/web/src/settings/watchers/FontWatcher.ts | 6 +-- apps/web/src/slash-commands/SlashCommands.tsx | 6 +-- apps/web/src/slash-commands/utils.ts | 2 +- apps/web/src/stores/BreadcrumbsStore.ts | 2 +- apps/web/src/stores/CallStore.ts | 4 +- .../stores/LatestRtcNotificationEventStore.ts | 6 +-- apps/web/src/stores/LifecycleStore.ts | 10 ++-- apps/web/src/stores/ModalWidgetStore.ts | 6 +-- apps/web/src/stores/MultiRoomViewStore.ts | 2 +- apps/web/src/stores/OwnBeaconStore.ts | 22 ++++----- apps/web/src/stores/OwnProfileStore.ts | 2 +- apps/web/src/stores/RoomViewStore.tsx | 8 ++-- apps/web/src/stores/SetupEncryptionStore.ts | 6 +-- apps/web/src/stores/TypingStore.ts | 6 +-- apps/web/src/stores/VoiceRecordingStore.ts | 5 +- apps/web/src/stores/WidgetStore.ts | 2 +- apps/web/src/stores/local-echo/EchoStore.ts | 2 +- .../message-preview/MessagePreviewStore.ts | 2 +- .../RoomNotificationStateStore.ts | 2 +- .../src/stores/right-panel/RightPanelStore.ts | 6 +-- .../stores/room-list-v3/RoomListStoreV3.ts | 4 +- apps/web/src/stores/spaces/SpaceStore.ts | 8 ++-- .../src/stores/widgets/WidgetLayoutStore.ts | 4 +- .../web/src/stores/widgets/WidgetMessaging.ts | 9 ++-- .../stores/widgets/WidgetMessagingStore.ts | 2 +- .../stores/widgets/WidgetPermissionStore.ts | 2 +- apps/web/src/toasts/AnalyticsToast.tsx | 4 +- .../src/toasts/DesktopNotificationsToast.ts | 2 +- apps/web/src/toasts/UpdateToast.tsx | 4 +- apps/web/src/utils/DMRoomMap.ts | 2 +- apps/web/src/utils/DialogOpener.ts | 6 +-- apps/web/src/utils/IdentityServerUtils.ts | 2 +- apps/web/src/utils/MultiInviter.ts | 2 +- apps/web/src/utils/WidgetUtils.ts | 3 +- .../web/src/utils/device/clientInformation.ts | 2 +- apps/web/src/utils/dm/createDmLocalRoom.ts | 2 +- apps/web/src/utils/leave-behaviour.ts | 2 +- apps/web/src/utils/promise.ts | 2 +- apps/web/src/utils/space.tsx | 4 +- apps/web/src/vector/jitsi/index.ts | 1 - .../src/viewmodels/menus/UserMenuViewModel.ts | 2 +- .../message-body/FileBodyViewModel.ts | 9 ++-- .../message-body/VideoBodyViewModel.ts | 2 +- .../room-list/RoomListHeaderViewModel.ts | 10 ++-- .../viewmodels/room-list/RoomListViewModel.ts | 20 ++++---- .../room/EventTileActionBarViewModel.ts | 2 +- .../viewmodels/room/RoomUploadViewModel.tsx | 4 +- .../WidgetContextMenuViewModel.tsx | 4 +- .../event-tile/body/AudioPlayerViewModel.ts | 8 ++-- .../event-tile/body/TextualBodyViewModel.tsx | 4 +- .../body/ViewSourceEventViewModel.ts | 2 +- .../ongoing/BaseOngoingCallTileViewModel.ts | 2 +- .../reactions/ReactionsRowButtonViewModel.ts | 4 +- .../viewmodels/structures/ResizerViewModel.ts | 4 +- apps/web/src/widgets/Jitsi.ts | 2 +- oxlint.config.ts | 10 +++- .../shared-components/src/core/i18n/i18n.tsx | 4 +- 240 files changed, 582 insertions(+), 575 deletions(-) diff --git a/apps/desktop/src/updater.ts b/apps/desktop/src/updater.ts index e6702d38c5..d7e6da788d 100644 --- a/apps/desktop/src/updater.ts +++ b/apps/desktop/src/updater.ts @@ -147,7 +147,7 @@ async function available(): Promise { 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 { } 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 }), diff --git a/apps/web/res/decoder-ring/decoder.js b/apps/web/res/decoder-ring/decoder.js index 866ff8be85..3c3dfd278a 100644 --- a/apps/web/res/decoder-ring/decoder.js +++ b/apps/web/res/decoder-ring/decoder.js @@ -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; diff --git a/apps/web/src/ContentMessages.ts b/apps/web/src/ContentMessages.ts index 601027c691..fdb5baad6c 100644 --- a/apps/web/src/ContentMessages.ts +++ b/apps/web/src/ContentMessages.ts @@ -271,7 +271,7 @@ function loadVideoElement(videoFile: File): Promise { video.src = dataUrl; video.load(); - video.play(); + void video.play(); }; reader.onerror = function (e): void { reject(e); diff --git a/apps/web/src/LegacyCallHandler.tsx b/apps/web/src/LegacyCallHandler.tsx index 48627d59ad..881b2113a5 100644 --- a/apps/web/src/LegacyCallHandler.tsx +++ b/apps/web/src/LegacyCallHandler.tsx @@ -142,7 +142,7 @@ export default class LegacyCallHandler extends TypedEventEmitter { - this.checkProtocols(maxTries - 1); + void this.checkProtocols(maxTries - 1); }, 10000); } } @@ -506,14 +506,14 @@ export default class LegacyCallHandler extends TypedEventEmitter { - 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({ action: Action.ViewRoom, @@ -886,7 +886,7 @@ export default class LegacyCallHandler extends TypedEventEmitter({ action: Action.ViewRoom, room_id: dmRoomId, @@ -1004,7 +1004,7 @@ export default class LegacyCallHandler extends TypedEventEmitter { 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 = 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 { } _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 { // 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(); } } } diff --git a/apps/web/src/MatrixClientPeg.ts b/apps/web/src/MatrixClientPeg.ts index aaf78fe791..8ba654b8d6 100644 --- a/apps/web/src/MatrixClientPeg.ts +++ b/apps/web/src/MatrixClientPeg.ts @@ -199,7 +199,7 @@ class MatrixClientPegClass implements IMatrixClientPeg { private onUnexpectedStoreClose = async (): Promise => { 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 diff --git a/apps/web/src/MediaDeviceHandler.ts b/apps/web/src/MediaDeviceHandler.ts index 461813c0b6..39bc690d85 100644 --- a/apps/web/src/MediaDeviceHandler.ts +++ b/apps/web/src/MediaDeviceHandler.ts @@ -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 { - 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 { - 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); } } diff --git a/apps/web/src/Modal.tsx b/apps/web/src/Modal.tsx index 79cf22859d..bc94b1d616 100644 --- a/apps/web/src/Modal.tsx +++ b/apps/web/src/Modal.tsx @@ -214,7 +214,7 @@ export class ModalManager extends TypedEventEmitter { + 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 { - this.updateAnonymityFromSettings(client, !!newValue); + void this.updateAnonymityFromSettings(client, !!newValue); }, ); } diff --git a/apps/web/src/Presence.ts b/apps/web/src/Presence.ts index 7ccafdf68c..0af2526185 100644 --- a/apps/web/src/Presence.ts +++ b/apps/web/src/Presence.ts @@ -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(); } }; diff --git a/apps/web/src/Registration.tsx b/apps/web/src/Registration.tsx index e580047acc..b3165a0e29 100644 --- a/apps/web/src/Registration.tsx +++ b/apps/web/src/Registration.tsx @@ -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) { diff --git a/apps/web/src/ScalarMessaging.ts b/apps/web/src/ScalarMessaging.ts index 4971a80671..1baec195f6 100644 --- a/apps/web/src/ScalarMessaging.ts +++ b/apps/web/src/ScalarMessaging.ts @@ -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 + "'"); diff --git a/apps/web/src/SlidingSyncManager.ts b/apps/web/src/SlidingSyncManager.ts index e92bf83fa0..3ba22b8298 100644 --- a/apps/web/src/SlidingSyncManager.ts +++ b/apps/web/src/SlidingSyncManager.ts @@ -384,7 +384,7 @@ export class SlidingSyncManager { public async setup(client: MatrixClient): Promise { 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; } diff --git a/apps/web/src/UserActivity.ts b/apps/web/src/UserActivity.ts index faf231ecdc..048f736724 100644 --- a/apps/web/src/UserActivity.ts +++ b/apps/web/src/UserActivity.ts @@ -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(); } diff --git a/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx b/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx index a7ac7f570d..cf7aeca4f1 100644 --- a/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx @@ -122,7 +122,7 @@ export default class ManageEventIndexDialog extends React.Component): 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 { diff --git a/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index dc7d77dbe6..aa43e97f72 100644 --- a/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -117,7 +117,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent): void => { @@ -268,11 +268,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent { - 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 // 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; } diff --git a/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx b/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx index 26ef2eec4d..cc806603e2 100644 --- a/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx @@ -85,10 +85,9 @@ export default class ImportE2eKeysDialog extends React.Component 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; }; diff --git a/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx b/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx index de3583fef9..7664528358 100644 --- a/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx @@ -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); } } diff --git a/apps/web/src/audio/BackgroundAudio.ts b/apps/web/src/audio/BackgroundAudio.ts index a5c92e299b..54429215b1 100644 --- a/apps/web/src/audio/BackgroundAudio.ts +++ b/apps/web/src/audio/BackgroundAudio.ts @@ -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(); } }; diff --git a/apps/web/src/audio/Playback.ts b/apps/web/src/audio/Playback.ts index 93dad591fe..759b5f8c4c 100644 --- a/apps/web/src/audio/Playback.ts +++ b/apps/web/src/audio/Playback.ts @@ -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(); diff --git a/apps/web/src/audio/PlaybackQueue.ts b/apps/web/src/audio/PlaybackQueue.ts index 025c9d2587..85cd33ecf6 100644 --- a/apps/web/src/audio/PlaybackQueue.ts +++ b/apps/web/src/audio/PlaybackQueue.ts @@ -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 { diff --git a/apps/web/src/audio/VoiceRecording.ts b/apps/web/src/audio/VoiceRecording.ts index 48a624d49b..914f4c6d3b 100644 --- a/apps/web/src/audio/VoiceRecording.ts +++ b/apps/web/src/audio/VoiceRecording.ts @@ -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(); } } diff --git a/apps/web/src/components/structures/EmbeddedPage.tsx b/apps/web/src/components/structures/EmbeddedPage.tsx index 4f2bd2f6a6..ac46241b8c 100644 --- a/apps/web/src/components/structures/EmbeddedPage.tsx +++ b/apps/web/src/components/structures/EmbeddedPage.tsx @@ -101,7 +101,7 @@ export default class EmbeddedPage extends React.PureComponent { // 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); } diff --git a/apps/web/src/components/structures/FilePanel.tsx b/apps/web/src/components/structures/FilePanel.tsx index 0cecad0a3e..9c4dd549bd 100644 --- a/apps/web/src/components/structures/FilePanel.tsx +++ b/apps/web/src/components/structures/FilePanel.tsx @@ -75,7 +75,7 @@ class FilePanel extends React.Component { 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()!); diff --git a/apps/web/src/components/structures/InteractiveAuth.tsx b/apps/web/src/components/structures/InteractiveAuth.tsx index 7a41403410..7a985974a5 100644 --- a/apps/web/src/components/structures/InteractiveAuth.tsx +++ b/apps/web/src/components/structures/InteractiveAuth.tsx @@ -128,7 +128,7 @@ export default class InteractiveAuthComponent extends React.Component { - this.authLogic.poll(); + void this.authLogic.poll(); }, 2000); } @@ -237,7 +237,7 @@ export default class InteractiveAuthComponent extends React.Component { - this.authLogic.submitAuthDict(authData); + void this.authLogic.submitAuthDict(authData); }; private onPhaseChange = (newPhase: number): void => { diff --git a/apps/web/src/components/structures/LegacyCallEventGrouper.ts b/apps/web/src/components/structures/LegacyCallEventGrouper.ts index 9390fd6400..5fab500cea 100644 --- a/apps/web/src/components/structures/LegacyCallEventGrouper.ts +++ b/apps/web/src/components/structures/LegacyCallEventGrouper.ts @@ -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 => { diff --git a/apps/web/src/components/structures/LoggedInView.tsx b/apps/web/src/components/structures/LoggedInView.tsx index 51f23ecc55..58666e3121 100644 --- a/apps/web/src/components/structures/LoggedInView.tsx +++ b/apps/web/src/components/structures/LoggedInView.tsx @@ -143,7 +143,7 @@ class LoggedInView extends React.Component { // 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 { 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 { 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 { 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 { }); 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 { 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 { undefined, false, ); - SettingsStore.setValue( + void SettingsStore.setValue( "showHiddenEventsInTimeline", null, SettingLevel.DEVICE, diff --git a/apps/web/src/components/structures/MatrixChat.tsx b/apps/web/src/components/structures/MatrixChat.tsx index 1d58cf35cd..65a4b08a99 100644 --- a/apps/web/src/components/structures/MatrixChat.tsx +++ b/apps/web/src/components/structures/MatrixChat.tsx @@ -324,7 +324,7 @@ export default class MatrixChat extends React.PureComponent { // 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 { 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 { 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 { 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 { } 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 { 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 { 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 { // 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 { 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 { 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 { // 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 { 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 { 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 { 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 { 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 { * 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 { } // 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 { 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 { 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" }); }); } diff --git a/apps/web/src/components/structures/RightPanel.tsx b/apps/web/src/components/structures/RightPanel.tsx index 00cdebe5b5..b221985627 100644 --- a/apps/web/src/components/structures/RightPanel.tsx +++ b/apps/web/src/components/structures/RightPanel.tsx @@ -139,7 +139,7 @@ export default class RightPanel extends React.Component { 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); } diff --git a/apps/web/src/components/structures/RoomSearchView.tsx b/apps/web/src/components/structures/RoomSearchView.tsx index 8892b197a3..f89c142baa 100644 --- a/apps/web/src/components/structures/RoomSearchView.tsx +++ b/apps/web/src/components/structures/RoomSearchView.tsx @@ -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; }; diff --git a/apps/web/src/components/structures/RoomView.tsx b/apps/web/src/components/structures/RoomView.tsx index 42f2d87808..47fb5b6243 100644 --- a/apps/web/src/components/structures/RoomView.tsx +++ b/apps/web/src/components/structures/RoomView.tsx @@ -585,7 +585,7 @@ export class RoomView extends React.Component { 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 { ), ]; - 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 { 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 { 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 { 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 { }, () => { // 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 { 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 { } 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 { 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 { 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 { 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 { () => { 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 { } 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 { }); 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 { // 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 { 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 { diff --git a/apps/web/src/components/structures/ScrollPanel.tsx b/apps/web/src/components/structures/ScrollPanel.tsx index 3be253a8e5..fc6ae1104d 100644 --- a/apps/web/src/components/structures/ScrollPanel.tsx +++ b/apps/web/src/components/structures/ScrollPanel.tsx @@ -229,8 +229,7 @@ export default class ScrollPanel extends React.Component { 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 { 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 { const refillDueToPropsUpdate = this.pendingFillDueToPropsUpdate; this.fillRequestWhileRunning = false; this.pendingFillDueToPropsUpdate = false; - // noinspection ES6MissingAwait - this.checkFillState(0, refillDueToPropsUpdate); + void this.checkFillState(0, refillDueToPropsUpdate); } }; diff --git a/apps/web/src/components/structures/SpaceRoomView.tsx b/apps/web/src/components/structures/SpaceRoomView.tsx index 569c15090a..bd87d88555 100644 --- a/apps/web/src/components/structures/SpaceRoomView.tsx +++ b/apps/web/src/components/structures/SpaceRoomView.tsx @@ -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; } } diff --git a/apps/web/src/components/structures/ThreadPanel.tsx b/apps/web/src/components/structures/ThreadPanel.tsx index c61d428b32..58dd88a802 100644 --- a/apps/web/src/components/structures/ThreadPanel.tsx +++ b/apps/web/src/components/structures/ThreadPanel.tsx @@ -170,7 +170,8 @@ const ThreadPanel: React.FC = ({ roomId, onClose, permalinkCreator }) => useEffect(() => { const room = mxClient.getRoom(roomId); - room?.createThreadsTimelineSets() + void room + ?.createThreadsTimelineSets() .then(() => room.fetchRoomThreads()) .then(() => { setFilterOption(ThreadFilterType.All); diff --git a/apps/web/src/components/structures/ThreadView.tsx b/apps/web/src/components/structures/ThreadView.tsx index 65602518b8..d4e7dfc8d6 100644 --- a/apps/web/src/components/structures/ThreadView.tsx +++ b/apps/web/src/components/structures/ThreadView.tsx @@ -110,7 +110,7 @@ export default class ThreadView extends React.Component { ); if (this.state.thread) { - this.postThreadUpdate(this.state.thread); + void this.postThreadUpdate(this.state.thread); } this.setupThread(this.props.mxEvent); diff --git a/apps/web/src/components/structures/TimelinePanel.tsx b/apps/web/src/components/structures/TimelinePanel.tsx index f05107d1ac..e2e5d8ab50 100644 --- a/apps/web/src/components/structures/TimelinePanel.tsx +++ b/apps/web/src/components/structures/TimelinePanel.tsx @@ -312,10 +312,10 @@ class TimelinePanel extends React.Component { 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 { // 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 { // 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 { 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 { }); 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 { 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 { // 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 diff --git a/apps/web/src/components/structures/UserView.tsx b/apps/web/src/components/structures/UserView.tsx index ded92b6eb9..c5a79bee15 100644 --- a/apps/web/src/components/structures/UserView.tsx +++ b/apps/web/src/components/structures/UserView.tsx @@ -43,7 +43,7 @@ export default class UserView extends React.Component { public componentDidMount(): void { if (this.props.userId) { - this.loadProfileInfo(); + void this.loadProfileInfo(); } } @@ -52,7 +52,7 @@ export default class UserView extends React.Component { // 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(); } } diff --git a/apps/web/src/components/structures/auth/ForgotPassword.tsx b/apps/web/src/components/structures/auth/ForgotPassword.tsx index e6de8edb8b..b9bfa1790a 100644 --- a/apps/web/src/components/structures/auth/ForgotPassword.tsx +++ b/apps/web/src/components/structures/auth/ForgotPassword.tsx @@ -106,7 +106,7 @@ export default class ForgotPassword extends React.Component { 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 { // 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 { 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; } }; diff --git a/apps/web/src/components/structures/auth/Login.tsx b/apps/web/src/components/structures/auth/Login.tsx index 36634dea90..c946202be2 100644 --- a/apps/web/src/components/structures/auth/Login.tsx +++ b/apps/web/src/components/structures/auth/Login.tsx @@ -126,7 +126,7 @@ class LoginComponent extends React.PureComponent { 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 { 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); } } diff --git a/apps/web/src/components/structures/auth/Registration.tsx b/apps/web/src/components/structures/auth/Registration.tsx index a7fd8ecdfc..b0f5754000 100644 --- a/apps/web/src/components/structures/auth/Registration.tsx +++ b/apps/web/src/components/structures/auth/Registration.tsx @@ -163,7 +163,7 @@ export default class Registration extends React.Component { } 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 { 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 { 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 { accessToken, }); - this.setupPushers(); + void this.setupPushers(); } } else { newState.busy = false; @@ -508,7 +508,7 @@ export default class Registration extends React.Component { 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, diff --git a/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx b/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx index 22b7a1adb5..96b6fac1ba 100644 --- a/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx @@ -94,7 +94,7 @@ export default class SetupEncryptionBody extends React.Component private onUsePassphraseClick = async (): Promise => { const store = SetupEncryptionStore.sharedInstance(); - store.usePassPhrase(); + await store.usePassPhrase(); }; private onVerifyClick = (): void => { @@ -110,9 +110,9 @@ export default class SetupEncryptionBody extends React.Component member: cli.getUser(userId) ?? undefined, }); - verificationFinished.then(async () => { + void verificationFinished.then(async () => { const request = await requestPromise; - request.cancel(); + void request.cancel(); this.props.onFinished(); }); }; diff --git a/apps/web/src/components/structures/auth/SoftLogout.tsx b/apps/web/src/components/structures/auth/SoftLogout.tsx index 171dde37ad..1728631fdf 100644 --- a/apps/web/src/components/structures/auth/SoftLogout.tsx +++ b/apps/web/src/components/structures/auth/SoftLogout.tsx @@ -79,16 +79,16 @@ export default class SoftLogout extends React.Component { 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(); }); }; diff --git a/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx b/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx index 9d88f1c8ce..bd3ef42c44 100644 --- a/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx +++ b/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx @@ -50,7 +50,7 @@ export const EnterEmail: React.FC = ({ } emailFieldRef.current?.focus(); - emailFieldRef.current?.validate({ allowEmpty: false, focused: true }); + void emailFieldRef.current?.validate({ allowEmpty: false, focused: true }); }; return ( diff --git a/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.ts b/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.ts index f285a59366..bbcd1df25e 100644 --- a/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.ts +++ b/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.ts @@ -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 diff --git a/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.ts b/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.ts index 1cb29029ea..fa534ef3bc 100644 --- a/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.ts +++ b/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.ts @@ -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); diff --git a/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx b/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx index 3c243feaec..770715997c 100644 --- a/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx +++ b/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx @@ -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(); } }; diff --git a/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx b/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx index 9da1020634..6b87d8b2cb 100644 --- a/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx +++ b/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx @@ -61,7 +61,7 @@ export default abstract class AudioPlayerBase extends switch (action) { case KeyBindingAction.Space: - this.playPauseRef.current?.toggleState(); + void this.playPauseRef.current?.toggleState(); break; case KeyBindingAction.ArrowLeft: this.seekRef.current?.left(); diff --git a/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx b/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx index 92d5415fef..bd5a686b4b 100644 --- a/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx +++ b/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx @@ -72,21 +72,17 @@ export default class LegacySeekBar extends React.PureComponent { } 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): 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 => { diff --git a/apps/web/src/components/views/auth/LanguageSelector.tsx b/apps/web/src/components/views/auth/LanguageSelector.tsx index e8dbf0cf4e..7242a266d2 100644 --- a/apps/web/src/components/views/auth/LanguageSelector.tsx +++ b/apps/web/src/components/views/auth/LanguageSelector.tsx @@ -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(); } } diff --git a/apps/web/src/components/views/auth/PasswordLogin.tsx b/apps/web/src/components/views/auth/PasswordLogin.tsx index 6898846a64..6a108c9eb5 100644 --- a/apps/web/src/components/views/auth/PasswordLogin.tsx +++ b/apps/web/src/components/views/auth/PasswordLogin.tsx @@ -174,7 +174,7 @@ export default class PasswordLogin extends React.PureComponent { // 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; } diff --git a/apps/web/src/components/views/auth/RegistrationForm.tsx b/apps/web/src/components/views/auth/RegistrationForm.tsx index 0577de31f5..3b6c86744a 100644 --- a/apps/web/src/components/views/auth/RegistrationForm.tsx +++ b/apps/web/src/components/views/auth/RegistrationForm.tsx @@ -124,7 +124,7 @@ export default class RegistrationForm extends React.PureComponent { + 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 = ({ de const getDevices = async (): Promise => { 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); }; diff --git a/apps/web/src/components/views/context_menus/MessageContextMenu.tsx b/apps/web/src/components/views/context_menus/MessageContextMenu.tsx index 086301ee57..d320782018 100644 --- a/apps/web/src/components/views/context_menus/MessageContextMenu.tsx +++ b/apps/web/src/components/views/context_menus/MessageContextMenu.tsx @@ -225,7 +225,7 @@ export default class MessageContextMenu extends React.Component 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 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 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 }; private onCopyClick = (): void => { - copyPlaintext(getSelectedText()); + void copyPlaintext(getSelectedText()); this.closeMenu(); }; diff --git a/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx b/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx index 5da2978f83..f7cec13c31 100644 --- a/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx +++ b/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx @@ -267,7 +267,7 @@ export const RoomGeneralContextMenu: React.FC = ({ return ( { - 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 = ({ return ( { - setMarkedUnreadState(room, cli, true); + void setMarkedUnreadState(room, cli, true); onFinished?.(); }, onPostMarkAsUnreadClick)} label={_t("room|context_menu|mark_unread")} diff --git a/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx b/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx index 49d8275ab6..c96ab24842 100644 --- a/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx +++ b/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx @@ -151,7 +151,7 @@ const SpaceContextMenu: React.FC = ({ space, hideHeader, onFinished, ... ev.stopPropagation(); PosthogTrackers.trackInteraction("WebSpaceContextMenuNewRoomItem", ev); - showCreateNewRoom(space); + void showCreateNewRoom(space); onFinished(); }; @@ -159,7 +159,7 @@ const SpaceContextMenu: React.FC = ({ space, hideHeader, onFinished, ... ev.preventDefault(); ev.stopPropagation(); - showCreateNewRoom(space, elementCallVideoRoomsEnabled ? RoomType.UnstableCall : RoomType.ElementVideo); + void showCreateNewRoom(space, elementCallVideoRoomsEnabled ? RoomType.UnstableCall : RoomType.ElementVideo); onFinished(); }; diff --git a/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx b/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx index fb6161f72c..ccba753848 100644 --- a/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx +++ b/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx @@ -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]); diff --git a/apps/web/src/components/views/dialogs/BugReportDialog.tsx b/apps/web/src/components/views/dialogs/BugReportDialog.tsx index f4bfc2f2c0..3b45113356 100644 --- a/apps/web/src/components/views/dialogs/BugReportDialog.tsx +++ b/apps/web/src/components/views/dialogs/BugReportDialog.tsx @@ -182,7 +182,7 @@ export default class BugReportDialog extends React.Component => { diff --git a/apps/web/src/components/views/dialogs/ChangelogDialog.tsx b/apps/web/src/components/views/dialogs/ChangelogDialog.tsx index b2eb151943..6af78a3150 100644 --- a/apps/web/src/components/views/dialogs/ChangelogDialog.tsx +++ b/apps/web/src/components/views/dialogs/ChangelogDialog.tsx @@ -84,7 +84,7 @@ export default class ChangelogDialog extends React.Component { 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]); } } diff --git a/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx b/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx index 17bf75ccad..796adb47ec 100644 --- a/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx +++ b/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx @@ -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(); diff --git a/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx b/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx index 5321390fca..e76519f0a5 100644 --- a/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx +++ b/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx @@ -176,7 +176,7 @@ export default class CreateRoomDialog extends React.Component { 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 { const action = getKeyBindingsManager().getAccessibilityAction(event); switch (action) { case KeyBindingAction.Enter: - this.onOk(); + void this.onOk(); event.preventDefault(); event.stopPropagation(); break; diff --git a/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx b/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx index 7223db55f9..f03d8955ed 100644 --- a/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx +++ b/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx @@ -53,7 +53,7 @@ const CreateSubspaceDialog: React.FC = ({ 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 = ({ 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; } diff --git a/apps/web/src/components/views/dialogs/ExportDialog.tsx b/apps/web/src/components/views/dialogs/ExportDialog.tsx index e6242fbbdf..9a94109d71 100644 --- a/apps/web/src/components/views/dialogs/ExportDialog.tsx +++ b/apps/web/src/components/views/dialogs/ExportDialog.tsx @@ -141,13 +141,13 @@ const ExportDialog: React.FC = ({ 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; } } diff --git a/apps/web/src/components/views/dialogs/FeedbackDialog.tsx b/apps/web/src/components/views/dialogs/FeedbackDialog.tsx index 40814d615a..c70f16de53 100644 --- a/apps/web/src/components/views/dialogs/FeedbackDialog.tsx +++ b/apps/web/src/components/views/dialogs/FeedbackDialog.tsx @@ -46,7 +46,7 @@ const FeedbackDialog: React.FC = (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"), diff --git a/apps/web/src/components/views/dialogs/ForwardDialog.tsx b/apps/web/src/components/views/dialogs/ForwardDialog.tsx index be88bf79e7..5805cd9380 100644 --- a/apps/web/src/components/views/dialogs/ForwardDialog.tsx +++ b/apps/web/src/components/views/dialogs/ForwardDialog.tsx @@ -253,7 +253,7 @@ const ForwardDialog: React.FC = ({ matrixClient: cli, event, permalinkCr const userId = cli.getSafeUserId(); const [profileInfo, setProfileInfo] = useState({}); useEffect(() => { - cli.getProfileInfo(userId).then((info) => setProfileInfo(info)); + void cli.getProfileInfo(userId).then((info) => setProfileInfo(info)); }, [cli, userId]); const { type, content } = transformEvent(event, cli); diff --git a/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx b/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx index 1a42aa3163..1da59f6e0b 100644 --- a/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx +++ b/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx @@ -39,7 +39,7 @@ const GenericFeatureFeedbackDialog: React.FC = ({ const sendFeedback = async (ok: boolean): Promise => { if (!ok) return onFinished(false); // TODO: Handle rejection. - submitFeedback(rageshakeLabel, comment, canContact, rageshakeData); + void submitFeedback(rageshakeLabel, comment, canContact, rageshakeData); onFinished(true); Modal.createDialog(InfoDialog, { diff --git a/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx b/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx index 18b5ae4b28..83730dc114 100644 --- a/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx @@ -67,7 +67,7 @@ export default class IncomingSasDialog extends React.Component { 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 { }; private onSasMatchesClick = (): void => { - this.showSasEvent?.confirm(); + void this.showSasEvent?.confirm(); this.setState({ phase: PHASE_WAIT_FOR_PARTNER_TO_CONFIRM, }); diff --git a/apps/web/src/components/views/dialogs/InviteDialog.tsx b/apps/web/src/components/views/dialogs/InviteDialog.tsx index 71eab828b4..3e8b36b7e1 100644 --- a/apps/web/src/components/views/dialogs/InviteDialog.tsx +++ b/apps/web/src/components/views/dialogs/InviteDialog.tsx @@ -249,7 +249,7 @@ export default class InviteDialog extends React.PureComponent): 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 { ev.preventDefault(); - this.transferCall(); + void this.transferCall(); }; private onDialChange = (ev: React.ChangeEvent): void => { diff --git a/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx index c6bf0e4e77..b674b8021e 100644 --- a/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -119,7 +119,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent { @@ -103,7 +103,7 @@ export default class ModalWidgetDialog extends React.PureComponent { - this.state.messaging?.updateTheme({ name: theme }); + void this.state.messaging?.updateTheme({ name: theme }); }; private onWidgetClose = (ev: CustomEvent): void => { @@ -177,7 +177,7 @@ export default class ModalWidgetDialog extends React.PureComponent { - this.state.messaging?.notifyModalWidgetButtonClicked(def.id); + void this.state.messaging?.notifyModalWidgetButtonClicked(def.id); }; const isDisabled = this.state.disabledButtonIds.includes(def.id); diff --git a/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx b/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx index 5a00d87bfe..9ba417bb80 100644 --- a/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx +++ b/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx @@ -31,7 +31,7 @@ const RegistrationEmailPromptDialog: React.FC = ({ onFinished }) => { if (!valid) { fieldRef.current.focus(); - fieldRef.current.validate({ focused: true }); + void fieldRef.current.validate({ focused: true }); return; } } diff --git a/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx b/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx index e62e3e90c7..58180fc097 100644 --- a/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx @@ -158,7 +158,7 @@ export default class ServerPickerDialog extends React.PureComponent { 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 => { diff --git a/apps/web/src/components/views/dialogs/SetEmailDialog.tsx b/apps/web/src/components/views/dialogs/SetEmailDialog.tsx index 5628df33ab..dd8faff670 100644 --- a/apps/web/src/components/views/dialogs/SetEmailDialog.tsx +++ b/apps/web/src/components/views/dialogs/SetEmailDialog.tsx @@ -71,7 +71,7 @@ export default class SetEmailDialog extends React.Component { 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 { 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, { diff --git a/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx b/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx index a2ca0034f5..5bbf7d9b20 100644 --- a/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx +++ b/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx @@ -39,7 +39,7 @@ const SpacePreferencesAppearanceTab: React.FC> = ({ space ) => { - SettingsStore.setValue( + void SettingsStore.setValue( "Spaces.showPeopleInSpace", space.roomId, SettingLevel.ROOM_ACCOUNT, diff --git a/apps/web/src/components/views/dialogs/TextInputDialog.tsx b/apps/web/src/components/views/dialogs/TextInputDialog.tsx index ed076bc472..c64cd48d09 100644 --- a/apps/web/src/components/views/dialogs/TextInputDialog.tsx +++ b/apps/web/src/components/views/dialogs/TextInputDialog.tsx @@ -74,7 +74,7 @@ export default class TextInputDialog extends React.Component { 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; } diff --git a/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx b/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx index 9414c9107b..df73ea7464 100644 --- a/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx +++ b/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx @@ -51,7 +51,7 @@ export default class VerificationRequestDialog extends React.Component { + 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) diff --git a/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx b/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx index 6a2ce75d5c..c9c9395dc0 100644 --- a/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx +++ b/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx @@ -54,7 +54,7 @@ const BaseTool: React.FC> = ({ children = message; } else if (onAction && actionLabel) { const onActionClick = (): void => { - onAction().then((msg) => { + void onAction().then((msg) => { if (typeof msg === "string") { setMessage(msg); } diff --git a/apps/web/src/components/views/dialogs/devtools/Event.tsx b/apps/web/src/components/views/dialogs/devtools/Event.tsx index c13fe181c6..23f3ab9c57 100644 --- a/apps/web/src/components/views/dialogs/devtools/Event.tsx +++ b/apps/web/src/components/views/dialogs/devtools/Event.tsx @@ -101,7 +101,7 @@ export const EventEditor: React.FC = ({ fieldDefs, defaultCon if (!valid) { contentField.current?.focus(); - contentField.current?.validate({ focused: true }); + void contentField.current?.validate({ focused: true }); return; } diff --git a/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index 1b241f4c23..b90944cbaa 100644 --- a/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -127,7 +127,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent | React.MouseEvent): Promise => { diff --git a/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index c221c99448..d6ec6973f3 100644 --- a/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -84,7 +84,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { @@ -109,7 +109,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { this.props.onFinished(false); - accessSecretStorage(async (): Promise => {}, { forceReset: true }); + void accessSecretStorage(async (): Promise => {}, { forceReset: true }); }; /** diff --git a/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index 8f04cebfd1..565524d8d0 100644 --- a/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -343,7 +343,8 @@ const SpotlightDialog: React.FC = ({ 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 = ({ 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 = ({ 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 = ({ initialText = "", initialFilter = n className="mx_SpotlightDialog_inviteLink" onClick={() => { setInviteLinkCopied(true); - copyPlaintext(ownInviteLink); + void copyPlaintext(ownInviteLink); }} onTooltipOpenChange={(open) => { if (!open) setInviteLinkCopied(false); diff --git a/apps/web/src/components/views/directory/NetworkDropdown.tsx b/apps/web/src/components/views/directory/NetworkDropdown.tsx index e1545f7f77..1ded6a2413 100644 --- a/apps/web/src/components/views/directory/NetworkDropdown.tsx +++ b/apps/web/src/components/views/directory/NetworkDropdown.tsx @@ -96,7 +96,7 @@ function useSettingsValueWithSetter( const setter = useCallback( async (value: Settings[S]["default"]): Promise => { setValue(value); - SettingsStore.setValue(settingName, roomId, level, value); + await SettingsStore.setValue(settingName, roomId, level, value); }, [level, roomId, settingName], ); diff --git a/apps/web/src/components/views/elements/AppTile.tsx b/apps/web/src/components/views/elements/AppTile.tsx index 3db1782118..625fc0cfb1 100644 --- a/apps/web/src/components/views/elements/AppTile.tsx +++ b/apps/web/src/components/views/elements/AppTile.tsx @@ -319,7 +319,7 @@ export default class AppTile extends React.Component { } 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 { // 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 { } private startWidget(): void { - this.messaging?.prepare().then(() => { + void this.messaging?.prepare().then(() => { if (this.unmounted) return; this.setState({ initialising: false }); }); diff --git a/apps/web/src/components/views/elements/EffectsOverlay.tsx b/apps/web/src/components/views/elements/EffectsOverlay.tsx index 6c154d218a..e49f1cdaa6 100644 --- a/apps/web/src/components/views/elements/EffectsOverlay.tsx +++ b/apps/web/src/components/views/elements/EffectsOverlay.tsx @@ -49,7 +49,7 @@ const EffectsOverlay: FunctionComponent = ({ 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 = ({ roomWidth }) => { for (const effect in currentEffects) { const effectModule: ICanvasEffect = currentEffects.get(effect)!; if (effectModule && effectModule.isRunning) { - effectModule.stop(); + void effectModule.stop(); } } }; diff --git a/apps/web/src/components/views/elements/ErrorBoundary.tsx b/apps/web/src/components/views/elements/ErrorBoundary.tsx index ae5e3f93bf..4d29e44873 100644 --- a/apps/web/src/components/views/elements/ErrorBoundary.tsx +++ b/apps/web/src/components/views/elements/ErrorBoundary.tsx @@ -52,7 +52,7 @@ export default class ErrorBoundary extends React.PureComponent { if (!PlatformPeg.get()) return; MatrixClientPeg.safeGet().stopClient(); - MatrixClientPeg.safeGet() + void MatrixClientPeg.safeGet() .store.deleteAllData() .then(() => { PlatformPeg.get()?.reload(); diff --git a/apps/web/src/components/views/elements/Field.tsx b/apps/web/src/components/views/elements/Field.tsx index 71e6d91f68..b765ec14e8 100644 --- a/apps/web/src/components/views/elements/Field.tsx +++ b/apps/web/src/components/views/elements/Field.tsx @@ -152,7 +152,7 @@ export default class Field extends React.PureComponent { * 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 { focused: true, }); if (this.props.validateOnFocus) { - this.validate({ + void this.validate({ focused: true, }); } @@ -201,7 +201,7 @@ export default class Field extends React.PureComponent { focused: false, }); if (this.props.validateOnBlur) { - this.validate({ + void this.validate({ focused: false, }); } diff --git a/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx b/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx index 90a86ab258..a7d633d1d8 100644 --- a/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -74,7 +74,7 @@ export default class IRCTimelineProfileResizer extends React.Component { if (this.props.roomId) { - SettingsStore.setValue( + void SettingsStore.setValue( "ircDisplayNameWidth", this.props.roomId, SettingLevel.ROOM_DEVICE, diff --git a/apps/web/src/components/views/elements/ImageView.tsx b/apps/web/src/components/views/elements/ImageView.tsx index 71578a0946..e1a3d667bb 100644 --- a/apps/web/src/components/views/elements/ImageView.tsx +++ b/apps/web/src/components/views/elements/ImageView.tsx @@ -315,7 +315,7 @@ export default class ImageView extends React.Component { ev.preventDefault(); ev.stopPropagation(); if (this.downloadFunction) { - this.downloadFunction(); + void this.downloadFunction(); } break; } diff --git a/apps/web/src/components/views/elements/PollCreateDialog.tsx b/apps/web/src/components/views/elements/PollCreateDialog.tsx index a97230c57f..c67a354fe7 100644 --- a/apps/web/src/components/views/elements/PollCreateDialog.tsx +++ b/apps/web/src/components/views/elements/PollCreateDialog.tsx @@ -174,7 +174,7 @@ export default class PollCreateDialog extends ScrollableBaseModal { + void finished.then(([tryAgain]) => { if (!tryAgain) { this.cancel(); } else { diff --git a/apps/web/src/components/views/elements/QRCode.tsx b/apps/web/src/components/views/elements/QRCode.tsx index 18458126f3..ec4e951ecd 100644 --- a/apps/web/src/components/views/elements/QRCode.tsx +++ b/apps/web/src/components/views/elements/QRCode.tsx @@ -31,7 +31,7 @@ const QRCode: React.FC = ({ 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); }); diff --git a/apps/web/src/components/views/elements/ReplyChain.tsx b/apps/web/src/components/views/elements/ReplyChain.tsx index ead388832c..d27a05b89c 100644 --- a/apps/web/src/components/views/elements/ReplyChain.tsx +++ b/apps/web/src/components/views/elements/ReplyChain.tsx @@ -86,7 +86,7 @@ export default class ReplyChain extends React.Component { public componentDidMount(): void { this.unmounted = false; - this.initialize(); + void this.initialize(); this.trySetExpandableQuotes(); } @@ -169,7 +169,7 @@ export default class ReplyChain extends React.Component { }; public collapse = (): void => { - this.initialize(); + void this.initialize(); }; private onQuoteClick = async (): Promise => { diff --git a/apps/web/src/components/views/elements/ServerPicker.tsx b/apps/web/src/components/views/elements/ServerPicker.tsx index fa25598c68..d7b6105164 100644 --- a/apps/web/src/components/views/elements/ServerPicker.tsx +++ b/apps/web/src/components/views/elements/ServerPicker.tsx @@ -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 => { diff --git a/apps/web/src/components/views/elements/SettingsDropdown.tsx b/apps/web/src/components/views/elements/SettingsDropdown.tsx index 85f448ea76..487e9bc7e3 100644 --- a/apps/web/src/components/views/elements/SettingsDropdown.tsx +++ b/apps/web/src/components/views/elements/SettingsDropdown.tsx @@ -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], diff --git a/apps/web/src/components/views/emojipicker/ReactionPicker.tsx b/apps/web/src/components/views/emojipicker/ReactionPicker.tsx index 19ed2a5385..a57c3fa2b3 100644 --- a/apps/web/src/components/views/emojipicker/ReactionPicker.tsx +++ b/apps/web/src/components/views/emojipicker/ReactionPicker.tsx @@ -92,7 +92,7 @@ class ReactionPicker extends React.Component { 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({ action: Action.FocusAComposer, context: this.context.timelineRenderingType, @@ -100,7 +100,7 @@ class ReactionPicker extends React.Component { // 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()!, diff --git a/apps/web/src/components/views/location/LocationPicker.tsx b/apps/web/src/components/views/location/LocationPicker.tsx index dce5699fcc..a961aa9de6 100644 --- a/apps/web/src/components/views/location/LocationPicker.tsx +++ b/apps/web/src/components/views/location/LocationPicker.tsx @@ -191,7 +191,7 @@ class LocationPicker extends React.Component { private onOk = (): void => { const { timeout, position } = this.state; - this.props.onChoose( + void this.props.onChoose( position ? { uri: getGeoUri(position), timestamp: position.timestamp, timeout } : { diff --git a/apps/web/src/components/views/location/LocationShareMenu.tsx b/apps/web/src/components/views/location/LocationShareMenu.tsx index 453ad33cea..1cbe545faf 100644 --- a/apps/web/src/components/views/location/LocationShareMenu.tsx +++ b/apps/web/src/components/views/location/LocationShareMenu.tsx @@ -63,7 +63,7 @@ const LocationShareMenu: React.FC = ({ 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; diff --git a/apps/web/src/components/views/messages/CallEvent.tsx b/apps/web/src/components/views/messages/CallEvent.tsx index 85677bda8d..b10edf5025 100644 --- a/apps/web/src/components/views/messages/CallEvent.tsx +++ b/apps/web/src/components/views/messages/CallEvent.tsx @@ -114,7 +114,7 @@ const ActiveLoadedCallEvent = ({ mxEvent, call, ref }: ActiveLoadedCallEventProp const disconnect = useCallback( (ev: ButtonEvent) => { ev.preventDefault(); - call.disconnect(); + void call.disconnect(); }, [call], ); diff --git a/apps/web/src/components/views/messages/CodeBlock.tsx b/apps/web/src/components/views/messages/CodeBlock.tsx index 172ea82984..5a046d9c2f 100644 --- a/apps/web/src/components/views/messages/CodeBlock.tsx +++ b/apps/web/src/components/views/messages/CodeBlock.tsx @@ -114,7 +114,7 @@ const CodeBlock: React.FC = ({ preNode }) => { } function highlightCodeRef(div: HTMLElement | null): void { - highlightCode(div); + void highlightCode(div); } let content = domToReact(preNode.children as DOMNode[]); diff --git a/apps/web/src/components/views/messages/MBeaconBody.tsx b/apps/web/src/components/views/messages/MBeaconBody.tsx index 48294296be..000a14f864 100644 --- a/apps/web/src/components/views/messages/MBeaconBody.tsx +++ b/apps/web/src/components/views/messages/MBeaconBody.tsx @@ -103,7 +103,7 @@ const useHandleBeaconRedaction = ( : undefined; relations?.getRelations()?.forEach((locationEvent) => { - matrixClient.redactEvent( + void matrixClient.redactEvent( locationEvent.getRoomId()!, locationEvent.getId()!, undefined, diff --git a/apps/web/src/components/views/messages/MPollBody.tsx b/apps/web/src/components/views/messages/MPollBody.tsx index e925726a2a..247c333428 100644 --- a/apps/web/src/components/views/messages/MPollBody.tsx +++ b/apps/web/src/components/views/messages/MPollBody.tsx @@ -157,7 +157,7 @@ export default class MPollBody extends React.Component { const room = this.context?.getRoom(this.props.mxEvent.getRoomId()); const poll = room?.polls.get(this.props.mxEvent.getId()!); if (poll) { - this.setPollInstance(poll); + void this.setPollInstance(poll); } else { room?.on(PollEvent.New, this.setPollInstance.bind(this)); } diff --git a/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx b/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx index d7913f08fa..dcf7eef9a9 100644 --- a/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx +++ b/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx @@ -69,7 +69,7 @@ const usePollVotes = (poll: Poll): Partial => { setResults(getWinningAnswers(poll, responseRelations)); poll.on(PollEvent.Responses, onPollResponses); - getResponses(); + void getResponses(); return () => { poll.off(PollEvent.Responses, onPollResponses); diff --git a/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts b/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts index d25ef6bfae..0842e27a6f 100644 --- a/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts +++ b/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts @@ -203,7 +203,7 @@ export const useFetchPastPolls = ( setTimelineSet(timelineSet); }; - getFilteredTimelineSet(); + void getFilteredTimelineSet(); }, [room, matrixClient]); const { isLoading, oldestEventTimestamp, loadMorePolls, loadTimelineHistory } = useTimelineHistory( @@ -213,7 +213,7 @@ export const useFetchPastPolls = ( ); useEffect(() => { - loadTimelineHistory(); + void loadTimelineHistory(); }, [loadTimelineHistory]); return { isLoading, oldestEventTimestamp, loadMorePolls }; diff --git a/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts b/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts index fb0714863d..a8f9048988 100644 --- a/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts +++ b/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts @@ -68,7 +68,7 @@ export const usePollsWithRelations = ( poll.on(PollEvent.Responses, onPollUpdate); // trigger request to get all responses // if they are not already in cache - poll.getResponses(); + void poll.getResponses(); } setPollsWithRelations(polls); } diff --git a/apps/web/src/components/views/right_panel/EncryptionPanel.tsx b/apps/web/src/components/views/right_panel/EncryptionPanel.tsx index 3a317a69e9..4498b5253e 100644 --- a/apps/web/src/components/views/right_panel/EncryptionPanel.tsx +++ b/apps/web/src/components/views/right_panel/EncryptionPanel.tsx @@ -66,7 +66,7 @@ const EncryptionPanel: React.FC = (props: IProps) => { setPhase(requestFromPromise?.phase); } if (verificationRequestPromise) { - awaitPromise(); + void awaitPromise(); } }, [verificationRequestPromise]); // Use a ref to track whether we are already showing the mismatch modal as state may not update fast enough diff --git a/apps/web/src/components/views/right_panel/ExtensionsCard.tsx b/apps/web/src/components/views/right_panel/ExtensionsCard.tsx index 290776fa01..a40ff3768b 100644 --- a/apps/web/src/components/views/right_panel/ExtensionsCard.tsx +++ b/apps/web/src/components/views/right_panel/ExtensionsCard.tsx @@ -153,8 +153,7 @@ const ExtensionsCard: React.FC = ({ room, onClose }) => { if (!managers.hasManager()) { managers.openNoManagerDialog(); } else { - // noinspection JSIgnoredPromiseFromCall - managers.getPrimaryManager()?.open(room); + void managers.getPrimaryManager()?.open(room); } }; diff --git a/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx b/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx index b2b4aa72cd..c39d865cba 100644 --- a/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx +++ b/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx @@ -58,7 +58,7 @@ export function PinnedMessagesCard({ room, onClose, permalinkCreator }: PinnedMe const newlyRead = pinnedEventIds.filter((id) => !readPinnedEvents.has(id)); if (newlyRead.length > 0) { // clear out any read pinned events which no longer are pinned - cli.setRoomAccountData(room.roomId, ReadPinsEventId, { + void cli.setRoomAccountData(room.roomId, ReadPinsEventId, { event_ids: pinnedEventIds, }); } diff --git a/apps/web/src/components/views/right_panel/UserInfo.tsx b/apps/web/src/components/views/right_panel/UserInfo.tsx index aced0b6b2f..3df4af8bdb 100644 --- a/apps/web/src/components/views/right_panel/UserInfo.tsx +++ b/apps/web/src/components/views/right_panel/UserInfo.tsx @@ -129,7 +129,7 @@ export const useDevices = (userId: string): IDevice[] | undefined | null => { setDevices(null); } } - downloadDeviceList(); + void downloadDeviceList(); // Handle being unmounted return () => { @@ -147,11 +147,11 @@ export const useDevices = (userId: string): IDevice[] | undefined | null => { }; const onDevicesUpdated = (users: string[]): void => { if (!users.includes(userId)) return; - updateDevices(); + void updateDevices(); }; const onUserTrustStatusChanged = (_userId: string, trustLevel: UserVerificationStatus): void => { if (_userId !== userId) return; - updateDevices(); + void updateDevices(); }; cli.on(CryptoEvent.DevicesUpdated, onDevicesUpdated); cli.on(CryptoEvent.UserTrustStatusChanged, onUserTrustStatusChanged); diff --git a/apps/web/src/components/views/right_panel/VerificationPanel.tsx b/apps/web/src/components/views/right_panel/VerificationPanel.tsx index 73a23e4d4e..daf7a76ea5 100644 --- a/apps/web/src/components/views/right_panel/VerificationPanel.tsx +++ b/apps/web/src/components/views/right_panel/VerificationPanel.tsx @@ -351,7 +351,7 @@ export default class VerificationPanel extends React.PureComponent { - this.state.sasEvent?.confirm(); + void this.state.sasEvent?.confirm(); }; private onSasMismatchesClick = (): void => { @@ -372,7 +372,7 @@ export default class VerificationPanel extends React.PureComponent { ev.preventDefault(); - vm.onKickClick(); + void vm.onKickClick(); }} disabled={isUpdating} label={vm.kickLabel} @@ -94,7 +94,7 @@ export const BanToggleButton = ({ role="button" onSelect={async (ev) => { ev.preventDefault(); - vm.onBanOrUnbanClick(); + void vm.onBanOrUnbanClick(); }} disabled={isUpdating} label={vm.banLabel} @@ -128,7 +128,7 @@ const MuteToggleButton: React.FC = ({ role="button" onSelect={async (ev) => { ev.preventDefault(); - vm.onMuteButtonClick(); + void vm.onMuteButtonClick(); }} disabled={isUpdating} label={vm.muteLabel} diff --git a/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx b/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx index cd80d77d85..cc0aece3d8 100644 --- a/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx +++ b/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx @@ -88,7 +88,7 @@ export const UserInfoBasicOptionsView: React.FC<{ role="button" onSelect={async (ev) => { ev.preventDefault(); - vm.onInviteUserButton(room.roomId, ev); + void vm.onInviteUserButton(room.roomId, ev); }} label={_t("action|invite")} Icon={InviteIcon} diff --git a/apps/web/src/components/views/room_settings/AliasSettings.tsx b/apps/web/src/components/views/room_settings/AliasSettings.tsx index 0ce0d500b3..b38e958ea1 100644 --- a/apps/web/src/components/views/room_settings/AliasSettings.tsx +++ b/apps/web/src/components/views/room_settings/AliasSettings.tsx @@ -50,7 +50,7 @@ class EditableAliasesList extends EditableItemList { } this.aliasField.current.focus(); - this.aliasField.current.validate({ allowEmpty: false, focused: true }); + void this.aliasField.current.validate({ allowEmpty: false, focused: true }); }; protected renderNewItemField(): JSX.Element { @@ -136,7 +136,7 @@ export default class AliasSettings extends React.Component { if (this.props.canSetCanonicalAlias) { // load local aliases for providing recommendations // for the canonical alias and alt_aliases - this.loadLocalAliases(); + void this.loadLocalAliases(); } } @@ -290,7 +290,7 @@ export default class AliasSettings extends React.Component { if (event.currentTarget.open) { // if local aliases haven't been preloaded yet at component mount if (!this.props.canSetCanonicalAlias && this.state.localAliases.length === 0) { - this.loadLocalAliases(); + void this.loadLocalAliases(); } } this.setState({ detailsOpen: event.currentTarget.open }); diff --git a/apps/web/src/components/views/room_settings/RoomPublishSetting.tsx b/apps/web/src/components/views/room_settings/RoomPublishSetting.tsx index 06afae6d77..ec27f7da18 100644 --- a/apps/web/src/components/views/room_settings/RoomPublishSetting.tsx +++ b/apps/web/src/components/views/room_settings/RoomPublishSetting.tsx @@ -66,7 +66,7 @@ export default class RoomPublishSetting extends React.PureComponent { + void client.getRoomDirectoryVisibility(this.props.roomId).then((result) => { this.setState({ isRoomPublished: result.visibility === "public" }); }); } diff --git a/apps/web/src/components/views/rooms/Autocomplete.tsx b/apps/web/src/components/views/rooms/Autocomplete.tsx index 3db8c540e0..39982ab942 100644 --- a/apps/web/src/components/views/rooms/Autocomplete.tsx +++ b/apps/web/src/components/views/rooms/Autocomplete.tsx @@ -92,7 +92,7 @@ export default class Autocomplete extends React.PureComponent { return; } - this.complete(this.props.query, this.props.selection); + void this.complete(this.props.query, this.props.selection); } public componentWillUnmount(): void { @@ -239,7 +239,7 @@ export default class Autocomplete extends React.PureComponent { hide: false, }, () => { - this.complete(this.props.query, this.props.selection).then(() => { + void this.complete(this.props.query, this.props.selection).then(() => { resolve(this.countCompletions()); }); }, diff --git a/apps/web/src/components/views/rooms/BasicMessageComposer.tsx b/apps/web/src/components/views/rooms/BasicMessageComposer.tsx index 226d470b9c..e98c67261a 100644 --- a/apps/web/src/components/views/rooms/BasicMessageComposer.tsx +++ b/apps/web/src/components/views/rooms/BasicMessageComposer.tsx @@ -288,7 +288,7 @@ export default class BasicMessageEditor extends React.Component if (this.isSafari) { this.onInput({ inputType: "insertCompositionText" }); } else { - Promise.resolve().then(() => { + void Promise.resolve().then(() => { this.onInput({ inputType: "insertCompositionText" }); }); } @@ -386,7 +386,7 @@ export default class BasicMessageEditor extends React.Component this.modifiedFlag = true; const sel = document.getSelection()!; const { caret, text } = getCaretOffsetAndText(this.editorRef.current, sel); - this.props.model.update(text, event.inputType, caret); + void this.props.model.update(text, event.inputType, caret); }; private insertText(textToInsert: string, inputType = "insertText"): void { @@ -410,7 +410,7 @@ export default class BasicMessageEditor extends React.Component const newText = text.slice(0, caret.offset) + textToInsert + text.slice(caret.offset); caret.offset += textToInsert.length; this.modifiedFlag = true; - this.props.model.update(newText, inputType, caret); + void this.props.model.update(newText, inputType, caret); } // this is used later to see if we need to recalculate the caret @@ -565,7 +565,7 @@ export default class BasicMessageEditor extends React.Component } } else if (autocompleteAction === KeyBindingAction.ForceCompleteAutocomplete && !this.state.showVisualBell) { // there is no current autocomplete window, try to open it - this.tabCompleteName(); + void this.tabCompleteName(); handled = true; } else if ([KeyBindingAction.Delete, KeyBindingAction.Backspace].includes(accessibilityAction!)) { this.formatBarRef.current?.hide(); @@ -899,7 +899,7 @@ export default class BasicMessageEditor extends React.Component const position = model.positionForOffset(caret.offset, caret.atNodeEnd); // Insert suffix only if the caret is at the start of the composer const parts = partCreator.createMentionParts(caret.offset === 0, displayName, userId); - model.transform(() => { + void model.transform(() => { const addedLen = model.insert(parts, position); return model.positionForOffset(caret.offset + addedLen, true); }); @@ -915,7 +915,7 @@ export default class BasicMessageEditor extends React.Component // add two newlines quoteParts.push(partCreator.newline()); quoteParts.push(partCreator.newline()); - model.transform(() => { + void model.transform(() => { const addedLen = model.insert(quoteParts, model.positionForOffset(0)); return model.positionForOffset(addedLen, true); }); @@ -929,7 +929,7 @@ export default class BasicMessageEditor extends React.Component const { partCreator } = model; const caret = this.getCaret(); const position = model.positionForOffset(caret.offset, caret.atNodeEnd); - model.transform(() => { + void model.transform(() => { const addedLen = model.insert(partCreator.plainWithEmoji(text), position); return model.positionForOffset(caret.offset + addedLen, true); }); diff --git a/apps/web/src/components/views/rooms/EditMessageComposer.tsx b/apps/web/src/components/views/rooms/EditMessageComposer.tsx index 970d8cffcd..44e24ceece 100644 --- a/apps/web/src/components/views/rooms/EditMessageComposer.tsx +++ b/apps/web/src/components/views/rooms/EditMessageComposer.tsx @@ -137,7 +137,7 @@ class EditMessageComposer extends React.Component this.props.mxEvent.on(ThreadEvent.Update, this.updateThread); - client.decryptEventIfNeeded(this.props.mxEvent); + void client.decryptEventIfNeeded(this.props.mxEvent); const room = client.getRoom(this.props.mxEvent.getRoomId()); room?.on(ThreadEvent.New, this.onNewThread); diff --git a/apps/web/src/components/views/rooms/MessageComposer.tsx b/apps/web/src/components/views/rooms/MessageComposer.tsx index e9debaf223..72677cbb56 100644 --- a/apps/web/src/components/views/rooms/MessageComposer.tsx +++ b/apps/web/src/components/views/rooms/MessageComposer.tsx @@ -324,7 +324,7 @@ export class MessageComposer extends React.Component { // Otherwise, wait for member loading to finish and then update the member for the avatar. // The members should already be loading, and loadMembersIfNeeded // will return the promise for the existing operation - this.props.room.loadMembersIfNeeded().then(() => { + void this.props.room.loadMembersIfNeeded().then(() => { const me = this.props.room.getMember(MatrixClientPeg.safeGet().getSafeUserId()) ?? undefined; this.setState({ me }); }); @@ -405,7 +405,7 @@ export class MessageComposer extends React.Component { // otherwise the send message function will think there are no URLs in // message and will not attach URL bundles const urlPreviewSnapshot = this.props.urlPreviewVm.getSnapshot(); - this.props.urlPreviewVm.updateWithText({ content: "", debounced: false }); + void this.props.urlPreviewVm.updateWithText({ content: "", debounced: false }); if (this.state.haveRecording && this.voiceRecordingButton.current) { // There shouldn't be any text message to send when a voice recording is active, so // just send out the voice recording. @@ -413,7 +413,7 @@ export class MessageComposer extends React.Component { return; } - this.messageComposerInput.current?.sendMessage({ urlPreviewSnapshot }); + void this.messageComposerInput.current?.sendMessage({ urlPreviewSnapshot }); if (this.state.isWysiwygLabEnabled) { const { relation, replyToEvent } = this.props; @@ -434,7 +434,7 @@ export class MessageComposer extends React.Component { }; private onChange = (model: EditorModel): void => { - this.props.urlPreviewVm.updateWithText({ + void this.props.urlPreviewVm.updateWithText({ content: model.contentPlainText, debounced: true, }); @@ -444,7 +444,7 @@ export class MessageComposer extends React.Component { }; private onWysiwygChange = (content: string): void => { - this.props.urlPreviewVm.updateWithText({ content, debounced: true }); + void this.props.urlPreviewVm.updateWithText({ content, debounced: true }); this.setState({ composerContent: content, isComposerEmpty: content?.length === 0, @@ -540,7 +540,7 @@ export class MessageComposer extends React.Component { } private onRecordStartEndClick = (): void => { - this.voiceRecordingButton.current?.onRecordStartEndClick(); + void this.voiceRecordingButton.current?.onRecordStartEndClick(); if (this.context.narrow) { this.toggleButtonMenu(); diff --git a/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx b/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx index 101a1afdf9..98337ae411 100644 --- a/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx +++ b/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx @@ -67,7 +67,7 @@ export const CallGuestLinkButton: React.FC<{ room: Room }> = ({ room }) => { showLinkModal(); } else { // the room needs to be set to public or knock to generate a link - Modal.createDialog(JoinRuleDialog, { + void Modal.createDialog(JoinRuleDialog, { room, // If the user cannot invite the Knocking is not given as an option. canInvite, diff --git a/apps/web/src/components/views/rooms/RoomPreviewBar.tsx b/apps/web/src/components/views/rooms/RoomPreviewBar.tsx index f3de47ca94..f76c1c39c3 100644 --- a/apps/web/src/components/views/rooms/RoomPreviewBar.tsx +++ b/apps/web/src/components/views/rooms/RoomPreviewBar.tsx @@ -127,12 +127,12 @@ class RoomPreviewBar extends React.Component { } public componentDidMount(): void { - this.checkInvitedEmail(); + void this.checkInvitedEmail(); } public componentDidUpdate(prevProps: IProps, prevState: IState): void { if (this.props.invitedEmail !== prevProps.invitedEmail || this.props.inviterName !== prevProps.inviterName) { - this.checkInvitedEmail(); + void this.checkInvitedEmail(); } } diff --git a/apps/web/src/components/views/rooms/SendMessageComposer.tsx b/apps/web/src/components/views/rooms/SendMessageComposer.tsx index 13cdefaa69..0b579e4b1f 100644 --- a/apps/web/src/components/views/rooms/SendMessageComposer.tsx +++ b/apps/web/src/components/views/rooms/SendMessageComposer.tsx @@ -204,7 +204,7 @@ export class SendMessageComposer extends React.Component { + void prom.then((resp) => { sendRoundTripMetric(this.props.mxClient, roomId, resp.event_id); }); } @@ -589,7 +589,7 @@ export class SendMessageComposer extends React.Component { console.log(error); diff --git a/apps/web/src/components/views/rooms/Stickerpicker.tsx b/apps/web/src/components/views/rooms/Stickerpicker.tsx index c20e7e0fca..9d566caf1b 100644 --- a/apps/web/src/components/views/rooms/Stickerpicker.tsx +++ b/apps/web/src/components/views/rooms/Stickerpicker.tsx @@ -328,8 +328,7 @@ export default class Stickerpicker extends React.PureComponent { * Launch the integration manager on the stickers integration page */ private launchManageIntegrations = (): void => { - // noinspection JSIgnoredPromiseFromCall - IntegrationManagers.sharedInstance() + void IntegrationManagers.sharedInstance() ?.getPrimaryManager() ?.open(this.props.room, `type_${WidgetType.STICKERPICKER.preferred}`, this.state.widgetId ?? undefined); }; diff --git a/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx b/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx index fdd171b210..e652e2fa3a 100644 --- a/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx +++ b/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx @@ -109,7 +109,6 @@ export default class VoiceRecordComposerTile extends React.PureComponent MatrixClientPeg.safeGet().sendMessage(actualRoomId, content), this.props.room.client, @@ -204,8 +204,8 @@ export default class VoiceRecordComposerTile extends React.PureComponent composerFunctions.insertText(payload.text)); + void setSelection(composerContext.selection).then(() => + composerFunctions.insertText(payload.text), + ); } break; } diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts index fcab8f4547..6c547fbcd7 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts @@ -59,7 +59,9 @@ export function useWysiwygSendActionHandler( } else if (payload.event) { // TODO insert quote message - see SendMessageComposer } else if (payload.text) { - setSelection(composerContext.selection).then(() => composerFunctions.insertText(payload.text)); + void setSelection(composerContext.selection).then(() => + composerFunctions.insertText(payload.text), + ); } break; } diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts index 1ff011c64a..ccae724c0a 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts @@ -159,7 +159,7 @@ export async function sendMessage( } }); if (SettingsStore.getValue("Performance.addSendMessageTimingMetadata")) { - prom.then((resp) => { + void prom.then((resp) => { sendRoundTripMetric(mxClient, roomId, resp.event_id); }); } diff --git a/apps/web/src/components/views/settings/AddRemoveThreepids.tsx b/apps/web/src/components/views/settings/AddRemoveThreepids.tsx index 301afd4d41..d7ad9b507a 100644 --- a/apps/web/src/components/views/settings/AddRemoveThreepids.tsx +++ b/apps/web/src/components/views/settings/AddRemoveThreepids.tsx @@ -120,7 +120,7 @@ const ExistingThreepid: React.FC = ({ mode, threepid, onC (e: ButtonEvent): void => { e.stopPropagation(); e.preventDefault(); - changeBinding({ + void changeBinding({ bind: false, label: "revoke", errorTitle: @@ -136,7 +136,7 @@ const ExistingThreepid: React.FC = ({ mode, threepid, onC (e: ButtonEvent): void => { e.stopPropagation(); e.preventDefault(); - changeBinding({ + void changeBinding({ bind: true, label: "share", errorTitle: diff --git a/apps/web/src/components/views/settings/EventIndexPanel.tsx b/apps/web/src/components/views/settings/EventIndexPanel.tsx index 121860d5ee..ba549fbb15 100644 --- a/apps/web/src/components/views/settings/EventIndexPanel.tsx +++ b/apps/web/src/components/views/settings/EventIndexPanel.tsx @@ -62,7 +62,7 @@ export default class EventIndexPanel extends React.Component { @@ -120,7 +120,7 @@ export default class EventIndexPanel extends React.Component { const { finished, close } = Modal.createDialog(SeshatResetDialog); - finished.then(async ([success]) => { + void finished.then(async ([success]) => { if (success) { await SettingsStore.setValue("enableEventIndexing", null, SettingLevel.DEVICE, false); await EventIndexPeg.deleteEventIndex(); diff --git a/apps/web/src/components/views/settings/ImageSizePanel.tsx b/apps/web/src/components/views/settings/ImageSizePanel.tsx index bb5d63faf2..32c2d942f5 100644 --- a/apps/web/src/components/views/settings/ImageSizePanel.tsx +++ b/apps/web/src/components/views/settings/ImageSizePanel.tsx @@ -35,8 +35,7 @@ export default class ImageSizePanel extends React.Component const newSize = ev.target.value as ImageSize; this.setState({ size: newSize }); - // noinspection JSIgnoredPromiseFromCall - SettingsStore.setValue("Images.size", null, SettingLevel.ACCOUNT, newSize); + void SettingsStore.setValue("Images.size", null, SettingLevel.ACCOUNT, newSize); }; public render(): React.ReactNode { diff --git a/apps/web/src/components/views/settings/JoinRuleSettings.tsx b/apps/web/src/components/views/settings/JoinRuleSettings.tsx index 2c7bdf7530..18270cbcc6 100644 --- a/apps/web/src/components/views/settings/JoinRuleSettings.tsx +++ b/apps/web/src/components/views/settings/JoinRuleSettings.tsx @@ -258,7 +258,7 @@ const JoinRuleSettings: React.FC = ({ if (restrictedAllowRoomIds.length > 0) { onRestrictedRoomIdsChange(restrictedAllowRoomIds); } else { - onChange(JoinRule.Invite); + void onChange(JoinRule.Invite); } }; diff --git a/apps/web/src/components/views/settings/LayoutSwitcher.tsx b/apps/web/src/components/views/settings/LayoutSwitcher.tsx index 5997c95707..908e3e6cc6 100644 --- a/apps/web/src/components/views/settings/LayoutSwitcher.tsx +++ b/apps/web/src/components/views/settings/LayoutSwitcher.tsx @@ -125,7 +125,7 @@ function useEventTileInfo(): EventTileInfo { }); }; - run(); + void run(); }, [userId, matrixClient, setEventTileInfo]); return eventTileInfo; } diff --git a/apps/web/src/components/views/settings/Notifications.tsx b/apps/web/src/components/views/settings/Notifications.tsx index ff2a2945e3..d5564e4628 100644 --- a/apps/web/src/components/views/settings/Notifications.tsx +++ b/apps/web/src/components/views/settings/Notifications.tsx @@ -237,9 +237,8 @@ export default class Notifications extends React.PureComponent, prevState: Readonly): void { if (this.state.deviceNotificationsEnabled !== prevState.deviceNotificationsEnabled) { - this.persistLocalNotificationSettings(this.state.deviceNotificationsEnabled); + void this.persistLocalNotificationSettings(this.state.deviceNotificationsEnabled); } } diff --git a/apps/web/src/components/views/settings/SetIdServer.tsx b/apps/web/src/components/views/settings/SetIdServer.tsx index 520c642172..fddc28453a 100644 --- a/apps/web/src/components/views/settings/SetIdServer.tsx +++ b/apps/web/src/components/views/settings/SetIdServer.tsx @@ -124,7 +124,7 @@ export default class SetIdServer extends React.Component { private saveIdServer = (fullUrl: string): void => { // Account data change will update localstorage, client, etc through dispatcher - MatrixClientPeg.safeGet().setAccountData("m.identity_server", { + void MatrixClientPeg.safeGet().setAccountData("m.identity_server", { base_url: fullUrl, }); this.setState({ @@ -311,7 +311,7 @@ export default class SetIdServer extends React.Component { private disconnectIdServer = (): void => { // Account data change will update localstorage, client, etc through dispatcher - MatrixClientPeg.safeGet().setAccountData("m.identity_server", { + void MatrixClientPeg.safeGet().setAccountData("m.identity_server", { base_url: null, // clear }); diff --git a/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx b/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx index ce4e4cb681..8db48a56f5 100644 --- a/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx +++ b/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx @@ -68,7 +68,7 @@ export const UserPersonalInfoSettings: React.FC = }, [client]); useEffect(() => { - updateThreepids(); + void updateThreepids(); }, [updateThreepids]); if (!SettingsStore.getValue(UIFeature.ThirdPartyID)) return null; diff --git a/apps/web/src/components/views/settings/devices/deleteDevices.ts b/apps/web/src/components/views/settings/devices/deleteDevices.ts index 894e23e0f7..af0bb80611 100644 --- a/apps/web/src/components/views/settings/devices/deleteDevices.ts +++ b/apps/web/src/components/views/settings/devices/deleteDevices.ts @@ -71,6 +71,6 @@ export const deleteDevicesWithInteractiveAuth = async ( [SSOAuthEntry.UNSTABLE_LOGIN_TYPE]: dialogAesthetics, }, }); - finished.then(([success]) => onFinished(success)); + void finished.then(([success]) => onFinished(success)); } }; diff --git a/apps/web/src/components/views/settings/devices/useOwnDevices.ts b/apps/web/src/components/views/settings/devices/useOwnDevices.ts index b30fb9da65..00cf5ad99c 100644 --- a/apps/web/src/components/views/settings/devices/useOwnDevices.ts +++ b/apps/web/src/components/views/settings/devices/useOwnDevices.ts @@ -97,7 +97,7 @@ export const useOwnDevices = (): DevicesState => { const [error, setError] = useState(); useEffect(() => { - matrixClient.doesServerSupportUnstableFeature("org.matrix.msc3881").then((hasSupport) => { + void matrixClient.doesServerSupportUnstableFeature("org.matrix.msc3881").then((hasSupport) => { setSupportsMSC3881(hasSupport); }); }, [matrixClient]); @@ -150,7 +150,7 @@ export const useOwnDevices = (): DevicesState => { }, [matrixClient]); useEffect(() => { - refreshDevices(); + void refreshDevices(); }, [refreshDevices]); useEffect(() => { @@ -164,7 +164,7 @@ export const useOwnDevices = (): DevicesState => { useEventEmitter(matrixClient, CryptoEvent.DevicesUpdated, (users: string[]): void => { if (users.includes(userId)) { - refreshDevices(); + void refreshDevices(); } }); diff --git a/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx b/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx index db66c93888..24f3d478dd 100644 --- a/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx +++ b/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx @@ -73,7 +73,7 @@ export const DiscoverySettings: React.FC = () => { if (payload.action === "id_server_changed") { setIdServerName(abbreviateUrl(client.getIdentityServerUrl())); - getThreepidState(); + void getThreepidState(); } }, [client, getThreepidState], diff --git a/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx b/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx index f62a429aa7..7764380f03 100644 --- a/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx +++ b/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx @@ -366,7 +366,7 @@ function KeyForm({ onCancelClick, onSubmit, recoveryKey, submitButtonLabel }: Ke return; } setIsKeyChangeInProgress(true); - onSubmit().finally(() => { + void onSubmit().finally(() => { setIsKeyChangeInProgress(false); }); }} diff --git a/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx b/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx index 35073f00e9..8d71e92768 100644 --- a/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx +++ b/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx @@ -33,7 +33,7 @@ export const KeyStoragePanel: React.FC = ({ onKeyStorageDisableClick }) = const onKeyBackupChange = useCallback( (e: FormEvent) => { if (e.currentTarget.checked) { - setEnabled(true); + void setEnabled(true); } else { onKeyStorageDisableClick(); } diff --git a/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx index b82dc4efcd..336c2651eb 100644 --- a/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx @@ -61,7 +61,7 @@ export default class AdvancedRoomSettingsTab extends React.Component { + void room.getRecommendedVersion().then((v) => { const tombstone = room.currentState.getStateEvents(EventType.RoomTombstone, ""); const additionalStateChanges: Partial = {}; diff --git a/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx index 68528852c0..6fafb079ad 100644 --- a/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx @@ -127,7 +127,7 @@ export default class NotificationsSettingsTab extends React.Component { e.stopPropagation(); e.preventDefault(); - SettingsStore.setValue("notificationSound", this.props.roomId, SettingLevel.ROOM_ACCOUNT, null); + void SettingsStore.setValue("notificationSound", this.props.roomId, SettingLevel.ROOM_ACCOUNT, null); this.setState({ currentSound: "default", diff --git a/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 65de4092fe..0c6f6a03a7 100644 --- a/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -141,7 +141,7 @@ export default class SecurityRoomSettingsTab extends React.Component { dialog.close(); - this.createNewRoom(false, true); + void this.createNewRoom(false, true); }} > {" "} @@ -170,7 +170,7 @@ export default class SecurityRoomSettingsTab extends React.Component { + await finished.then(([confirm]) => { if (!confirm) { this.setState({ encrypted: false }); return; @@ -344,7 +344,7 @@ export default class SecurityRoomSettingsTab extends React.Component { dialog.close(); - this.createNewRoom(true, false); + void this.createNewRoom(true, false); }} > {" "} diff --git a/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx index a5705694e9..e9b99fe39b 100644 --- a/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx @@ -66,7 +66,7 @@ const ElementCallSwitch: React.FC = ({ room }) => { newContent.events[ElementCallMemberEventType.name] = adminLevel; } - room.client.sendStateEvent(room.roomId, EventType.RoomPowerLevels, newContent); + void room.client.sendStateEvent(room.roomId, EventType.RoomPowerLevels, newContent); }, [room.client, room.roomId, content, isPublic], ); diff --git a/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx index ccfb8160ab..fae5d6bb11 100644 --- a/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx @@ -165,7 +165,7 @@ const AccountUserSettingsTab: React.FC = ({ closeSettingsFn }) => { const onDeactivateClicked = useCallback((): void => { const { finished } = Modal.createDialog(DeactivateAccountDialog); - finished.then(([success]) => { + void finished.then(([success]) => { if (success) closeSettingsFn(); }); }, [closeSettingsFn]); diff --git a/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index fe5fa52be0..9bf12ed1fd 100644 --- a/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -86,7 +86,7 @@ export default class AppearanceUserSettingsTab extends React.Component { const { finished } = Modal.createDialog(SetupEncryptionDialog); - finished.then(onFinish); + void finished.then(onFinish); }} > {_t("settings|encryption|device_not_verified_button")} diff --git a/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index 0b9f2999f5..283c1043e8 100644 --- a/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -74,7 +74,7 @@ export default class HelpUserSettingsTab extends React.Component { + void this.context.store.deleteAllData().then(() => { PlatformPeg.get()?.reload(); }); }; diff --git a/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx b/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx index 1194f2fd02..9c51bf744e 100644 --- a/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx +++ b/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx @@ -19,7 +19,7 @@ export const MediaPreviewAccountSettings: React.FC<{ roomId?: string }> = ({ roo const changeSetting = useCallback( (newValue: MediaPreviewConfig) => { - SettingsStore.setValue( + void SettingsStore.setValue( "mediaPreviewConfig", roomId ?? null, roomId ? SettingLevel.ROOM_ACCOUNT : SettingLevel.ACCOUNT, diff --git a/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 2cf3dfb9ee..d25479627e 100644 --- a/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -52,7 +52,7 @@ const LanguageSection: React.FC = () => { (newLanguage: string) => { if (language === newLanguage) return; - SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage); + void SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage); setLanguage(newLanguage); const platform = PlatformPeg.get(); if (platform) { @@ -185,7 +185,7 @@ export default class PreferencesUserSettingsTab extends React.Component { this.setState({ timezone: tz }); - TimezoneHandler.setUserTimezone(tz); + void TimezoneHandler.setUserTimezone(tz); }; /** @@ -204,17 +204,22 @@ export default class PreferencesUserSettingsTab extends React.Component): void => { this.setState({ autocompleteDelay: e.target.value }); - SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.valueAsNumber); }; private onReadMarkerInViewThresholdMs = (e: React.ChangeEvent): void => { this.setState({ readMarkerInViewThresholdMs: e.target.value }); - SettingsStore.setValue("readMarkerInViewThresholdMs", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue("readMarkerInViewThresholdMs", null, SettingLevel.DEVICE, e.target.valueAsNumber); }; private onReadMarkerOutOfViewThresholdMs = (e: React.ChangeEvent): void => { this.setState({ readMarkerOutOfViewThresholdMs: e.target.value }); - SettingsStore.setValue("readMarkerOutOfViewThresholdMs", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue( + "readMarkerOutOfViewThresholdMs", + null, + SettingLevel.DEVICE, + e.target.valueAsNumber, + ); }; private renderGroup(settingIds: BooleanSettingKey[], level = SettingLevel.ACCOUNT): JSX.Element { diff --git a/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index f10f10e9ce..174522522f 100644 --- a/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -160,7 +160,7 @@ export default class SecurityUserSettingsTab extends React.Component ({ waitingUnignored: [...waitingUnignored, userId] })); - MatrixClientPeg.safeGet().setIgnoredUsers(currentlyIgnoredUserIds); + await MatrixClientPeg.safeGet().setIgnoredUsers(currentlyIgnoredUserIds); } }; @@ -215,11 +215,11 @@ export default class SecurityUserSettingsTab extends React.Component { - this.manageInvites(true); + void this.manageInvites(true); }; private onRejectAllInvitesClicked = (): void => { - this.manageInvites(false); + void this.manageInvites(false); }; private renderIgnoredUsers(): JSX.Element { diff --git a/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx b/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx index 2e14aed20a..d07070f828 100644 --- a/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx @@ -199,7 +199,7 @@ const SessionManagerTab: React.FC<{ const onVerifyCurrentDevice = (): void => { const { finished } = Modal.createDialog(SetupEncryptionDialog); - finished.then(refreshDevices); + void finished.then(refreshDevices); }; const onTriggerDeviceVerification = useCallback( @@ -212,9 +212,9 @@ const SessionManagerTab: React.FC<{ verificationRequestPromise, member: currentUserMember, }); - finished.then(async () => { + void finished.then(async () => { const request = await verificationRequestPromise; - request.cancel(); + void request.cancel(); await refreshDevices(); }); }, @@ -247,7 +247,7 @@ const SessionManagerTab: React.FC<{ const signOutAllOtherSessions = shouldShowOtherSessions && !disableMultipleSignout ? () => { - onSignOutOtherDevices(Object.keys(otherDevices)); + void onSignOutOtherDevices(Object.keys(otherDevices)); } : undefined; diff --git a/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx b/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx index 3fd76c49a0..9b73b1d6ff 100644 --- a/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx @@ -158,7 +158,7 @@ export const SpaceCreateForm: React.FC = ({ const newName = ev.target.value; if (!alias || alias === `#${nameToLocalpart(name)}:${domain}`) { setAlias(`#${nameToLocalpart(newName)}:${domain}`); - aliasFieldRef.current?.validate({ allowEmpty: true }); + void aliasFieldRef.current?.validate({ allowEmpty: true }); } setName(newName); }} @@ -216,7 +216,8 @@ const SpaceCreateMenu: React.FC<{ 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"); }) @@ -233,7 +234,7 @@ const SpaceCreateMenu: React.FC<{ // 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; } @@ -244,7 +245,7 @@ const SpaceCreateMenu: React.FC<{ !(await spaceAliasField.current.validate({ allowEmpty: false })) ) { spaceAliasField.current.focus(); - spaceAliasField.current.validate({ allowEmpty: false, focused: true }); + void spaceAliasField.current.validate({ allowEmpty: false, focused: true }); setBusy(false); return; } diff --git a/apps/web/src/components/views/spaces/SpacePanel.tsx b/apps/web/src/components/views/spaces/SpacePanel.tsx index cf21d26404..41aba1ad0a 100644 --- a/apps/web/src/components/views/spaces/SpacePanel.tsx +++ b/apps/web/src/components/views/spaces/SpacePanel.tsx @@ -112,7 +112,12 @@ export const HomeButtonContextMenu: React.FC { onFinished(); - SettingsStore.setValue("Spaces.allRoomsInHome", null, SettingLevel.ACCOUNT, !allRoomsInHome); + void SettingsStore.setValue( + "Spaces.allRoomsInHome", + null, + SettingLevel.ACCOUNT, + !allRoomsInHome, + ); }} /> diff --git a/apps/web/src/components/views/toasts/VerificationRequestToast.tsx b/apps/web/src/components/views/toasts/VerificationRequestToast.tsx index 0abcf53063..6b40ab074f 100644 --- a/apps/web/src/components/views/toasts/VerificationRequestToast.tsx +++ b/apps/web/src/components/views/toasts/VerificationRequestToast.tsx @@ -96,7 +96,7 @@ export default class VerificationRequestToast extends React.PureComponent { ToastStore.sharedInstance().dismissToast(this.props.toastKey); try { - this.props.request.cancel(); + void this.props.request.cancel(); } catch (err) { logger.error("Error while cancelling verification request", err); } @@ -134,7 +134,7 @@ export default class VerificationRequestToast extends React.PureComponent request.cancel()); + void finished.then(() => request.cancel()); } await request.accept(); } catch (err) { diff --git a/apps/web/src/components/views/voip/AudioFeed.tsx b/apps/web/src/components/views/voip/AudioFeed.tsx index f8d28c5449..3053dceb07 100644 --- a/apps/web/src/components/views/voip/AudioFeed.tsx +++ b/apps/web/src/components/views/voip/AudioFeed.tsx @@ -34,7 +34,7 @@ export default class AudioFeed extends React.Component { public componentDidMount(): void { MediaDeviceHandler.instance.addListener(MediaDeviceHandlerEvent.AudioOutputChanged, this.onAudioOutputChanged); this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream); - this.playMedia(); + void this.playMedia(); } public componentWillUnmount(): void { @@ -54,7 +54,7 @@ export default class AudioFeed extends React.Component { // it fails. // It seems reliable if you set the sink ID after setting the srcObject and then set the sink ID // back to the default after the call is over - Dave - element!.setSinkId(audioOutput); + void element!.setSinkId(audioOutput); } catch (e) { logger.error("Couldn't set requested audio output device: using default", e); logger.warn("Couldn't set requested audio output device: using default", e); @@ -107,7 +107,7 @@ export default class AudioFeed extends React.Component { this.setState({ audioMuted: this.props.feed.isAudioMuted(), }); - this.playMedia(); + void this.playMedia(); }; public render(): React.ReactNode { diff --git a/apps/web/src/components/views/voip/CallView.tsx b/apps/web/src/components/views/voip/CallView.tsx index 4863e61b71..86d82934c6 100644 --- a/apps/web/src/components/views/voip/CallView.tsx +++ b/apps/web/src/components/views/voip/CallView.tsx @@ -30,7 +30,7 @@ const JoinCallView: FC = ({ room, resizing, call, role, onClo useEffect(() => { // We'll take this opportunity to tidy up our room state - call.clean(); + void call.clean(); }, [call]); const disconnectAllOtherCalls: () => Promise = useCallback(async () => { diff --git a/apps/web/src/components/views/voip/DialPadModal.tsx b/apps/web/src/components/views/voip/DialPadModal.tsx index 9b7cb1949f..7ad4bbbbc9 100644 --- a/apps/web/src/components/views/voip/DialPadModal.tsx +++ b/apps/web/src/components/views/voip/DialPadModal.tsx @@ -43,7 +43,7 @@ export default class DialpadModal extends React.PureComponent { public onFormSubmit = (ev: SyntheticEvent): void => { ev.preventDefault(); - this.onDialPress(); + void this.onDialPress(); }; public onDigitPress = (digit: string, ev: ButtonEvent): void => { @@ -70,7 +70,7 @@ export default class DialpadModal extends React.PureComponent { }; public onDialPress = async (): Promise => { - SDKContextClass.instance.legacyCallHandler.dialNumber(this.state.value); + void SDKContextClass.instance.legacyCallHandler.dialNumber(this.state.value); this.props.onFinished(true); }; diff --git a/apps/web/src/components/views/voip/LegacyCallView.tsx b/apps/web/src/components/views/voip/LegacyCallView.tsx index 0dc6955ffb..e0893f496c 100644 --- a/apps/web/src/components/views/voip/LegacyCallView.tsx +++ b/apps/web/src/components/views/voip/LegacyCallView.tsx @@ -72,11 +72,11 @@ function getFullScreenElement(): Element | null { } function requestFullscreen(element: Element): void { - element.requestFullscreen(); + void element.requestFullscreen(); } function exitFullscreen(): void { - document.exitFullscreen(); + void document.exitFullscreen(); } export default class LegacyCallView extends React.Component { @@ -289,14 +289,14 @@ export default class LegacyCallView extends React.Component { const callAction = getKeyBindingsManager().getCallAction(ev); switch (callAction) { case KeyBindingAction.ToggleMicInCall: - this.onMicMuteClick(); + void this.onMicMuteClick(); // show the controls to give feedback this.buttonsRef.current?.showControls(); handled = true; break; case KeyBindingAction.ToggleWebcamInCall: - this.onVidMuteClick(); + void this.onVidMuteClick(); // show the controls to give feedback this.buttonsRef.current?.showControls(); handled = true; @@ -316,7 +316,7 @@ export default class LegacyCallView extends React.Component { private onTransferClick = (): void => { const transfereeCall = this.context.legacyCallHandler.getTransfereeForCallId(this.props.call.callId); - if (transfereeCall) this.props.call.transferToCall(transfereeCall); + if (transfereeCall) void this.props.call.transferToCall(transfereeCall); }; private onHangupClick = (): void => { diff --git a/apps/web/src/components/views/voip/VideoFeed.tsx b/apps/web/src/components/views/voip/VideoFeed.tsx index 9023491901..6130381d25 100644 --- a/apps/web/src/components/views/voip/VideoFeed.tsx +++ b/apps/web/src/components/views/voip/VideoFeed.tsx @@ -60,7 +60,7 @@ export default class VideoFeed extends React.PureComponent { public componentDidMount(): void { this.updateFeed(null, this.props.feed); - this.playMedia(); + void this.playMedia(); } public componentWillUnmount(): void { @@ -71,7 +71,7 @@ export default class VideoFeed extends React.PureComponent { this.updateFeed(prevProps.feed, this.props.feed); // If the mutes state has changed, we try to playMedia() if (prevState.videoMuted !== this.state.videoMuted || prevProps.feed.stream !== this.props.feed.stream) { - this.playMedia(); + void this.playMedia(); } } @@ -109,7 +109,7 @@ export default class VideoFeed extends React.PureComponent { if (this.props.feed.purpose === SDPStreamMetadataPurpose.Usermedia) { this.props.feed.measureVolumeActivity(true); } - this.playMedia(); + void this.playMedia(); } } @@ -158,7 +158,7 @@ export default class VideoFeed extends React.PureComponent { audioMuted: this.props.feed.isAudioMuted(), videoMuted: this.props.feed.isVideoMuted(), }); - this.playMedia(); + void this.playMedia(); }; private onMuteStateChanged = (): void => { diff --git a/apps/web/src/contexts/SDKContextClass.ts b/apps/web/src/contexts/SDKContextClass.ts index 70d7f817d9..ad6eb5d7f9 100644 --- a/apps/web/src/contexts/SDKContextClass.ts +++ b/apps/web/src/contexts/SDKContextClass.ts @@ -160,7 +160,7 @@ export class SDKContextClass { public get spaceStore(): SpaceStore { if (!this._SpaceStore) { this._SpaceStore = new SpaceStore(defaultDispatcher, this); - this._SpaceStore.start(); + void this._SpaceStore.start(); } return this._SpaceStore; } @@ -215,7 +215,7 @@ export class SDKContextClass { public get latestRtcNotificationEventStore(): LatestRtcNotificationEventStore { if (!this._LatestRtcNotificationEventStore) { this._LatestRtcNotificationEventStore = new LatestRtcNotificationEventStore(this.callStore); - this._LatestRtcNotificationEventStore.start(); + void this._LatestRtcNotificationEventStore.start(); } return this._LatestRtcNotificationEventStore; } diff --git a/apps/web/src/device-listener/DeviceListener.ts b/apps/web/src/device-listener/DeviceListener.ts index f4e3fa3e82..76babb826c 100644 --- a/apps/web/src/device-listener/DeviceListener.ts +++ b/apps/web/src/device-listener/DeviceListener.ts @@ -98,7 +98,7 @@ export class DeviceListener { ); this.dispatcherRef = dis.register(this.onAction); this.recheck(); - this.updateClientInformation(); + void this.updateClientInformation(); } public stop(): void { @@ -227,7 +227,7 @@ export class DeviceListener { private onAction = ({ action }: ActionPayload): void => { if (action !== Action.OnLoggedIn) return; this.recheck(); - this.updateClientInformation(); + void this.updateClientInformation(); }; public recheck(): void { @@ -353,7 +353,7 @@ export class DeviceListener { this.shouldRecordClientInformation = !!newValue; if (this.shouldRecordClientInformation !== prevValue) { - this.updateClientInformation(); + void this.updateClientInformation(); } }; diff --git a/apps/web/src/device-listener/DeviceListenerOtherDevices.ts b/apps/web/src/device-listener/DeviceListenerOtherDevices.ts index d39d77ef60..aee02be056 100644 --- a/apps/web/src/device-listener/DeviceListenerOtherDevices.ts +++ b/apps/web/src/device-listener/DeviceListenerOtherDevices.ts @@ -187,7 +187,7 @@ export class DeviceListenerOtherDevices { // Show toasts for new unverified devices if they aren't already there for (const deviceId of newUnverifiedDeviceIds) { - showUnverifiedSessionToast(deviceId); + void showUnverifiedSessionToast(deviceId); } // ...and hide any we don't need any more diff --git a/apps/web/src/editor/operations.ts b/apps/web/src/editor/operations.ts index cde38ce44e..91b6f1f67c 100644 --- a/apps/web/src/editor/operations.ts +++ b/apps/web/src/editor/operations.ts @@ -59,7 +59,7 @@ export function formatRange(range: Range, action: Formatting): void { export function replaceRangeAndExpandSelection(range: Range, newParts: Part[]): void { const { model } = range; - model.transform(() => { + void model.transform(() => { const oldLen = range.length; const addedLen = range.replace(newParts); const firstOffset = range.start.asOffset(model); @@ -70,7 +70,7 @@ export function replaceRangeAndExpandSelection(range: Range, newParts: Part[]): export function replaceRangeAndMoveCaret(range: Range, newParts: Part[], offset = 0, atNodeEnd = false): void { const { model } = range; - model.transform(() => { + void model.transform(() => { const oldLen = range.length; const addedLen = range.replace(newParts); const firstOffset = range.start.asOffset(model); @@ -113,7 +113,7 @@ export function replaceRangeAndAutoAdjustCaret( } } // Calculate new position with respect to the previous position - model.transform(() => { + void model.transform(() => { const offsetDirection = Math.sign(range.replace(newParts)); // Compensates for shrinkage or expansion const atEnd = distanceFromEnd === suffixLength; return lastStartingPosition diff --git a/apps/web/src/emojipicker/recent.ts b/apps/web/src/emojipicker/recent.ts index 302b5b92af..5d9ec88b45 100644 --- a/apps/web/src/emojipicker/recent.ts +++ b/apps/web/src/emojipicker/recent.ts @@ -73,7 +73,12 @@ export function add(emoji: string): void { newEntry = { emoji, total: 1 }; } - SettingsStore.setValue(SETTING_NAME, null, SettingLevel.ACCOUNT, [newEntry, ...recents].slice(0, STORAGE_LIMIT)); + void SettingsStore.setValue( + SETTING_NAME, + null, + SettingLevel.ACCOUNT, + [newEntry, ...recents].slice(0, STORAGE_LIMIT), + ); } export function get(limit = 24): string[] { diff --git a/apps/web/src/hooks/room/useRoomCall.ts b/apps/web/src/hooks/room/useRoomCall.ts index d06eb42dcf..b4a6c959de 100644 --- a/apps/web/src/hooks/room/useRoomCall.ts +++ b/apps/web/src/hooks/room/useRoomCall.ts @@ -269,7 +269,7 @@ export const useRoomCall = ( if (widget && promptPinWidget) { sdkContext.widgetLayoutStore.moveToContainer(room, widget, "top"); } else { - placeCall( + void placeCall( sdkContext.legacyCallHandler, room, CallType.Voice, @@ -289,7 +289,7 @@ export const useRoomCall = ( } else { // If we have pressed shift then always skip the lobby, otherwise `undefined` will defer // to the defaults of the call implementation. - placeCall( + void placeCall( sdkContext.legacyCallHandler, room, CallType.Video, diff --git a/apps/web/src/hooks/spotlight/useRecentSearches.ts b/apps/web/src/hooks/spotlight/useRecentSearches.ts index 5adf643953..204ce0c838 100644 --- a/apps/web/src/hooks/spotlight/useRecentSearches.ts +++ b/apps/web/src/hooks/spotlight/useRecentSearches.ts @@ -24,7 +24,7 @@ export const useRecentSearches = (): [Room[], () => void] => { return [ rooms, () => { - SettingsStore.setValue("SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, []); + void SettingsStore.setValue("SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, []); setRooms([]); }, ]; diff --git a/apps/web/src/hooks/useAsyncMemo.ts b/apps/web/src/hooks/useAsyncMemo.ts index d5d9906565..6b3c113f53 100644 --- a/apps/web/src/hooks/useAsyncMemo.ts +++ b/apps/web/src/hooks/useAsyncMemo.ts @@ -16,7 +16,7 @@ export function useAsyncMemo(fn: Fn, deps: DependencyList, initialValue?: const [value, setValue] = useState(initialValue); useEffect(() => { let discard = false; - fn().then((v) => { + void fn().then((v) => { if (!discard) { setValue(v); } diff --git a/apps/web/src/hooks/useEncryptionStatus.ts b/apps/web/src/hooks/useEncryptionStatus.ts index 75c894c803..7e8d71a412 100644 --- a/apps/web/src/hooks/useEncryptionStatus.ts +++ b/apps/web/src/hooks/useEncryptionStatus.ts @@ -22,7 +22,7 @@ export function useEncryptionStatus(client: MatrixClient, room: Room): E2EStatus throttle( () => { if (client.getCrypto()) { - shieldStatusForRoom(client, room).then((e2eStatus) => { + void shieldStatusForRoom(client, room).then((e2eStatus) => { setE2eStatus(e2eStatus); }); } diff --git a/apps/web/src/hooks/useEventEmitter.ts b/apps/web/src/hooks/useEventEmitter.ts index dc71257a78..804682670e 100644 --- a/apps/web/src/hooks/useEventEmitter.ts +++ b/apps/web/src/hooks/useEventEmitter.ts @@ -165,7 +165,7 @@ export function useEventEmitterAsyncState { if (!(v instanceof NoChange)) { setValue(v); diff --git a/apps/web/src/hooks/usePermalinkEvent.ts b/apps/web/src/hooks/usePermalinkEvent.ts index 85adc20dc9..d1ea81036f 100644 --- a/apps/web/src/hooks/usePermalinkEvent.ts +++ b/apps/web/src/hooks/usePermalinkEvent.ts @@ -74,7 +74,7 @@ export const usePermalinkEvent = ( } catch {} }; - fetchRoomEvent(); + void fetchRoomEvent(); }, [event, eventId, parseResult?.eventId, parseResult?.roomIdOrAlias, shouldLookUpEvent]); return event; diff --git a/apps/web/src/hooks/usePermalinkMember.ts b/apps/web/src/hooks/usePermalinkMember.ts index f583e418cb..031014c332 100644 --- a/apps/web/src/hooks/usePermalinkMember.ts +++ b/apps/web/src/hooks/usePermalinkMember.ts @@ -120,7 +120,7 @@ export const usePermalinkMember = ( } }; - doProfileLookup(); + void doProfileLookup(); }, [context, member, shouldLookUpUser, targetRoom, userId]); return member; diff --git a/apps/web/src/hooks/usePublicRoomDirectory.ts b/apps/web/src/hooks/usePublicRoomDirectory.ts index dd6cd3382d..086228046e 100644 --- a/apps/web/src/hooks/usePublicRoomDirectory.ts +++ b/apps/web/src/hooks/usePublicRoomDirectory.ts @@ -128,7 +128,7 @@ export const usePublicRoomDirectory = (): { ); useEffect(() => { - initProtocols(); + void initProtocols(); }, []); useEffect(() => { diff --git a/apps/web/src/hooks/useSpaceResults.ts b/apps/web/src/hooks/useSpaceResults.ts index c6844cc86b..166a6f7b06 100644 --- a/apps/web/src/hooks/useSpaceResults.ts +++ b/apps/web/src/hooks/useSpaceResults.ts @@ -32,7 +32,7 @@ export const useSpaceResults = (space: Room | undefined, query: string): [Hierar // oxlint-disable-next-line no-unmodified-loop-condition while (hierarchy?.canLoadMore && !unmounted && space === hierarchy.root) { await hierarchy.load(); - if (hierarchy.canLoadMore) hierarchy.load(); // start next load so that the loading attribute is right + if (hierarchy.canLoadMore) void hierarchy.load(); // start next load so that the loading attribute is right setRooms(hierarchy.rooms!); } })(); diff --git a/apps/web/src/indexing/EventIndex.ts b/apps/web/src/indexing/EventIndex.ts index 6b6f351012..73a855a841 100644 --- a/apps/web/src/indexing/EventIndex.ts +++ b/apps/web/src/indexing/EventIndex.ts @@ -262,7 +262,7 @@ export default class EventIndex extends EventEmitter { if (ev.getType() === EventType.RoomEncryption && !(await this.isRoomIndexed(state.roomId))) { this.logger.debug("Adding a checkpoint for a newly encrypted room", state.roomId); - this.addRoomCheckpoint(state.roomId, true); + await this.addRoomCheckpoint(state.roomId, true); } }; @@ -296,7 +296,7 @@ export default class EventIndex extends EventEmitter { this.logger.debug("Adding a checkpoint because of a limited timeline", room.roomId); - this.addRoomCheckpoint(room.roomId, false); + await this.addRoomCheckpoint(room.roomId, false); }; /** diff --git a/apps/web/src/modules/ProxiedModuleApi.ts b/apps/web/src/modules/ProxiedModuleApi.ts index 84a8fa0d3c..2b8d5962df 100644 --- a/apps/web/src/modules/ProxiedModuleApi.ts +++ b/apps/web/src/modules/ProxiedModuleApi.ts @@ -86,7 +86,7 @@ export class ProxiedModuleApi implements ModuleApi { typeof initialTitleOrOptions === "string" ? { title: initialTitleOrOptions } : initialTitleOrOptions; return new Promise<{ didOkOrSubmit: boolean; model: M }>((resolve) => { - Modal.createDialog( + void Modal.createDialog( ModuleUiDialog, { initialOptions, diff --git a/apps/web/src/rageshake/rageshake.ts b/apps/web/src/rageshake/rageshake.ts index 0ce1966478..e190d2a631 100644 --- a/apps/web/src/rageshake/rageshake.ts +++ b/apps/web/src/rageshake/rageshake.ts @@ -533,7 +533,7 @@ export function tryInitStorage(): Promise { global.mx_rage_initStoragePromise = global.mx_rage_store.connect(); // Fire off a task in the background which will clean up old logs in the store - global.mx_rage_initStoragePromise.then(() => { + void global.mx_rage_initStoragePromise.then(() => { global.mx_rage_store.consume().catch((e) => { logger.error("Error cleaning up rageshake store", e); }); @@ -549,7 +549,7 @@ export function flush(): void { if (!global.mx_rage_store) { return; } - global.mx_rage_store.flush(); + void global.mx_rage_store.flush(); } /** diff --git a/apps/web/src/sendTimePerformanceMetrics.ts b/apps/web/src/sendTimePerformanceMetrics.ts index 45298b2cd2..0aa418bef7 100644 --- a/apps/web/src/sendTimePerformanceMetrics.ts +++ b/apps/web/src/sendTimePerformanceMetrics.ts @@ -27,8 +27,7 @@ export function decorateStartSendingTime(content: IContent): void { * @param {string} forEventId The event ID for the decorated event. */ export function sendRoundTripMetric(client: MatrixClient, inRoomId: string, forEventId: string): void { - // noinspection JSIgnoredPromiseFromCall - client.sendEvent(inRoomId, "io.element.performance_metric", { + void client.sendEvent(inRoomId, "io.element.performance_metric", { "io.element.performance_metrics": { forEventId: forEventId, responseTs: Date.now(), diff --git a/apps/web/src/settings/SettingsStore.ts b/apps/web/src/settings/SettingsStore.ts index b0342692da..fff20b55fd 100644 --- a/apps/web/src/settings/SettingsStore.ts +++ b/apps/web/src/settings/SettingsStore.ts @@ -674,7 +674,7 @@ export default class SettingsStore { .filter((k) => k.startsWith("mx_ShowImage_")) .map((k) => [k.slice("mx_ShowImage_".length), true]), ); - this.setValue("showMediaEventIds", null, SettingLevel.DEVICE, newValue); + void this.setValue("showMediaEventIds", null, SettingLevel.DEVICE, newValue); localStorage.setItem(MIGRATION_DONE_FLAG, "true"); } @@ -701,7 +701,7 @@ export default class SettingsStore { const showAvatarsOnInvites = handler.getValue("showAvatarsOnInvites", null); if (typeof showImages === "boolean" || typeof showAvatarsOnInvites === "boolean") { - this.setValue("mediaPreviewConfig", null, SettingLevel.ACCOUNT, { + await this.setValue("mediaPreviewConfig", null, SettingLevel.ACCOUNT, { invite_avatars: showAvatarsOnInvites === false ? MediaPreviewValue.Off : MediaPreviewValue.On, media_previews: showImages === false ? MediaPreviewValue.Off : MediaPreviewValue.On, }); diff --git a/apps/web/src/settings/controllers/InviteRulesConfigController.ts b/apps/web/src/settings/controllers/InviteRulesConfigController.ts index 74d3253dbf..eed57b0bf2 100644 --- a/apps/web/src/settings/controllers/InviteRulesConfigController.ts +++ b/apps/web/src/settings/controllers/InviteRulesConfigController.ts @@ -33,7 +33,7 @@ export default class InviteRulesConfigController extends MatrixClientBackedContr } public initMatrixClient(newClient: MatrixClient): void { - newClient.doesServerSupportUnstableFeature("org.matrix.msc4155").then((result) => { + void newClient.doesServerSupportUnstableFeature("org.matrix.msc4155").then((result) => { this.featureSupported = result; }); } diff --git a/apps/web/src/settings/handlers/AccountSettingsHandler.ts b/apps/web/src/settings/handlers/AccountSettingsHandler.ts index 9ea7a43c57..59ebedb20d 100644 --- a/apps/web/src/settings/handlers/AccountSettingsHandler.ts +++ b/apps/web/src/settings/handlers/AccountSettingsHandler.ts @@ -128,7 +128,7 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa // Write true as it is the default. This will give us the option // of making this opt-in in the future, without affecting old // users - this.setValue(settingName, roomId, true); + void this.setValue(settingName, roomId, true); return true; } return value; diff --git a/apps/web/src/settings/handlers/PlatformSettingsHandler.ts b/apps/web/src/settings/handlers/PlatformSettingsHandler.ts index 4741f35530..8f0ec76719 100644 --- a/apps/web/src/settings/handlers/PlatformSettingsHandler.ts +++ b/apps/web/src/settings/handlers/PlatformSettingsHandler.ts @@ -31,7 +31,7 @@ export default class PlatformSettingsHandler extends SettingsHandler { // Load setting values as they are async and `getValue` must be synchronous Object.entries(SETTINGS).forEach(([key, setting]) => { if (setting.supportedLevels?.includes(SettingLevel.PLATFORM) && platform.supportsSetting(key)) { - platform.getSettingValue(key).then((value: any) => { + void platform.getSettingValue(key).then((value: any) => { this.store[key] = value; }); } diff --git a/apps/web/src/settings/watchers/FontWatcher.ts b/apps/web/src/settings/watchers/FontWatcher.ts index ee6813a7a4..54c4a0e264 100644 --- a/apps/web/src/settings/watchers/FontWatcher.ts +++ b/apps/web/src/settings/watchers/FontWatcher.ts @@ -56,7 +56,7 @@ export class FontWatcher implements IWatcher { } private updateFont(): void { - this.setRootFontSize(SettingsStore.getValue("fontSizeDelta")); + void this.setRootFontSize(SettingsStore.getValue("fontSizeDelta")); this.setSystemFont({ useBundledEmojiFont: SettingsStore.getValue("useBundledEmojiFont"), useSystemFont: SettingsStore.getValue("useSystemFont"), @@ -66,12 +66,12 @@ export class FontWatcher implements IWatcher { private onAction = (payload: ActionPayload): void => { if (payload.action === Action.UpdateFontSizeDelta) { - this.setRootFontSize(payload.delta); + void this.setRootFontSize(payload.delta); } else if (payload.action === Action.UpdateSystemFont) { this.setSystemFont(payload as UpdateSystemFontPayload); } else if (payload.action === Action.OnLoggedOut) { // Clear font overrides when logging out - this.setRootFontSize(FontWatcher.DEFAULT_DELTA); + void this.setRootFontSize(FontWatcher.DEFAULT_DELTA); this.setSystemFont({ useBundledEmojiFont: false, useSystemFont: false, diff --git a/apps/web/src/slash-commands/SlashCommands.tsx b/apps/web/src/slash-commands/SlashCommands.tsx index ae56c9e316..a8e1ae9b6f 100644 --- a/apps/web/src/slash-commands/SlashCommands.tsx +++ b/apps/web/src/slash-commands/SlashCommands.tsx @@ -608,7 +608,7 @@ export const Commands = [ return success( finished.then(([confirmed]) => { - if (confirmed) manuallyVerifyDevice(cli, deviceId, fingerprint); + if (confirmed) void manuallyVerifyDevice(cli, deviceId, fingerprint); }), ); } @@ -624,7 +624,7 @@ export const Commands = [ isEnabled: (cli) => !isCurrentLocalRoom(cli), runFn: function (cli, roomId) { try { - cli.getCrypto()?.forceDiscardSession(roomId); + void cli.getCrypto()?.forceDiscardSession(roomId); } catch (e) { return reject(e instanceof Error ? e.message : e); } @@ -755,7 +755,7 @@ export const Commands = [ metricsViaKeyboard: true, }); if (msg) { - cli.sendTextMessage(roomId, msg); + void cli.sendTextMessage(roomId, msg); } })(), ); diff --git a/apps/web/src/slash-commands/utils.ts b/apps/web/src/slash-commands/utils.ts index 40ec7c2744..12c9f79dbd 100644 --- a/apps/web/src/slash-commands/utils.ts +++ b/apps/web/src/slash-commands/utils.ts @@ -55,7 +55,7 @@ export const singleMxcUpload = async (cli: MatrixClient): Promise if (!file) return; const { finished } = Modal.createDialog(UploadConfirmDialog, { file }); - finished.then(async ([shouldContinue]) => { + void finished.then(async ([shouldContinue]) => { if (shouldContinue) { const { content_uri: uri } = await cli.uploadContent(file); resolve(uri); diff --git a/apps/web/src/stores/BreadcrumbsStore.ts b/apps/web/src/stores/BreadcrumbsStore.ts index e1df06076b..3e9a56a82f 100644 --- a/apps/web/src/stores/BreadcrumbsStore.ts +++ b/apps/web/src/stores/BreadcrumbsStore.ts @@ -29,7 +29,7 @@ interface IState { export class BreadcrumbsStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new BreadcrumbsStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/CallStore.ts b/apps/web/src/stores/CallStore.ts index d5ce82665e..f23ccb9f11 100644 --- a/apps/web/src/stores/CallStore.ts +++ b/apps/web/src/stores/CallStore.ts @@ -36,7 +36,7 @@ export class CallStore extends AsyncStoreWithClient { public static get instance(): CallStore { if (!this._instance) { this._instance = new CallStore(); - this._instance.start(); + void this._instance.start(); } return this._instance; } @@ -144,7 +144,7 @@ export class CallStore extends AsyncStoreWithClient { this.emit(CallStoreEvent.ConnectedCalls, value, prevValue); // The room IDs are persisted to settings so we can detect unclean disconnects - SettingsStore.setValue( + void SettingsStore.setValue( "activeCallRoomIds", null, SettingLevel.DEVICE, diff --git a/apps/web/src/stores/LatestRtcNotificationEventStore.ts b/apps/web/src/stores/LatestRtcNotificationEventStore.ts index d309a86b73..d2fccb3601 100644 --- a/apps/web/src/stores/LatestRtcNotificationEventStore.ts +++ b/apps/web/src/stores/LatestRtcNotificationEventStore.ts @@ -70,7 +70,7 @@ export class LatestRtcNotificationEventStore extends AsyncStoreWithClient { this.callStore.on(CallStoreEvent.Call, this.onCallStoreEvent); - this.populateMap(); + await this.populateMap(); } protected async onNotReady(): Promise { @@ -91,12 +91,12 @@ export class LatestRtcNotificationEventStore extends AsyncStoreWithClient { - this.findAndSetNotificationEvent(call, roomId); + void this.findAndSetNotificationEvent(call, roomId); }); } } diff --git a/apps/web/src/stores/LifecycleStore.ts b/apps/web/src/stores/LifecycleStore.ts index 52334a71ce..734c5a8cf7 100644 --- a/apps/web/src/stores/LifecycleStore.ts +++ b/apps/web/src/stores/LifecycleStore.ts @@ -42,12 +42,12 @@ class LifecycleStore extends AsyncStore { protected onDispatch(payload: ActionPayload | DoAfterSyncPreparedPayload): void { switch (payload.action) { case Action.DoAfterSyncPrepared: - this.updateState({ + void this.updateState({ deferredAction: payload.deferred_action, }); break; case "cancel_after_sync_prepared": - this.updateState({ + void this.updateState({ deferredAction: null, }); break; @@ -55,7 +55,7 @@ class LifecycleStore extends AsyncStore { if (payload.state === SyncState.Syncing && payload.prevState !== SyncState.Syncing) { // We've reconnected to the server: update server version support // This is async but we don't care about the result, so just fire & forget. - checkServerVersions(); + void checkServerVersions(); } if (payload.state !== "PREPARED") { @@ -63,7 +63,7 @@ class LifecycleStore extends AsyncStore { } if (!this.state.deferredAction) break; const deferredAction = Object.assign({}, this.state.deferredAction); - this.updateState({ + void this.updateState({ deferredAction: null, }); dis.dispatch(deferredAction); @@ -71,7 +71,7 @@ class LifecycleStore extends AsyncStore { } case Action.ClientNotViable: case Action.OnLoggedOut: - this.reset(); + void this.reset(); break; } } diff --git a/apps/web/src/stores/ModalWidgetStore.ts b/apps/web/src/stores/ModalWidgetStore.ts index a1c5a5aa06..90bc20714f 100644 --- a/apps/web/src/stores/ModalWidgetStore.ts +++ b/apps/web/src/stores/ModalWidgetStore.ts @@ -24,7 +24,7 @@ interface IState { export class ModalWidgetStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new ModalWidgetStore(); - instance.start(); + void instance.start(); return instance; })(); private modalInstance: IHandle | null = null; @@ -66,7 +66,7 @@ export class ModalWidgetStore extends AsyncStoreWithClient { /* priority = */ false, /* static = */ true, ); - this.modalInstance.finished.then(([success, data]) => { + void this.modalInstance.finished.then(([success, data]) => { this.closeModalWidget(sourceWidget, widgetRoomId, success && data ? data : { "m.exited": true }); this.openSourceWidgetId = null; @@ -92,7 +92,7 @@ export class ModalWidgetStore extends AsyncStoreWithClient { logger.error("No source widget API for modal widget"); return; } - sourceMessaging.widgetApi.notifyModalWidgetClose(data); + void sourceMessaging.widgetApi.notifyModalWidgetClose(data); } }; } diff --git a/apps/web/src/stores/MultiRoomViewStore.ts b/apps/web/src/stores/MultiRoomViewStore.ts index 201458933b..cfe9489605 100644 --- a/apps/web/src/stores/MultiRoomViewStore.ts +++ b/apps/web/src/stores/MultiRoomViewStore.ts @@ -37,7 +37,7 @@ export class MultiRoomViewStore { : new RoomViewStore(this.dispatcher, this.sdkContextClass, roomId); // RoomView component does not render the room unless you call viewRoom - store.viewRoom({ + void store.viewRoom({ action: Action.ViewRoom, room_id: roomId, metricsTrigger: undefined, diff --git a/apps/web/src/stores/OwnBeaconStore.ts b/apps/web/src/stores/OwnBeaconStore.ts index 5ce458a492..e6b848fc54 100644 --- a/apps/web/src/stores/OwnBeaconStore.ts +++ b/apps/web/src/stores/OwnBeaconStore.ts @@ -87,7 +87,7 @@ const getLocallyCreatedBeaconEventIds = (): string[] => { export class OwnBeaconStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new OwnBeaconStore(); - instance.start(); + void instance.start(); return instance; })(); // users beacons, keyed by event type @@ -208,7 +208,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // instead of just one that was changed // to keep lastPublishedTimestamp simple // and extra published locations don't hurt - this.publishCurrentLocationToBeacons(); + void this.publishCurrentLocationToBeacons(); }; public getLiveBeaconIds = (roomId?: string): string[] => { @@ -280,7 +280,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // beacon expired, update beacon to un-alive state if (!isLive) { - this.stopBeacon(beacon.identifier); + void this.stopBeacon(beacon.identifier); } this.checkLiveness(); @@ -406,7 +406,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // it will be created below by togglePollingLocation // and publish first position quickly if (diff.added.length && this.isMonitoringLiveLocation) { - this.publishCurrentLocationToBeacons(); + void this.publishCurrentLocationToBeacons(); } // if overall liveness changed @@ -441,7 +441,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { private togglePollingLocation = (): void => { if (!!this.liveBeaconIds.length) { - this.startPollingLocation(); + void this.startPollingLocation(); } else { this.stopPollingLocation(); } @@ -455,7 +455,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { this.clearPositionWatch = watchPosition(this.onWatchedPosition, this.onGeolocationError); } catch (error) { if (error instanceof Error) { - this.onGeolocationError(error.message as GeolocationError); + await this.onGeolocationError(error.message as GeolocationError); } else { console.error("Unexpected error", error); } @@ -470,7 +470,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // if position was last updated STATIC_UPDATE_INTERVAL ms ago or more // get our position and publish it if (this.lastPublishedPositionTimestamp <= Date.now() - STATIC_UPDATE_INTERVAL) { - this.publishCurrentLocationToBeacons(); + void this.publishCurrentLocationToBeacons(); } }, STATIC_UPDATE_INTERVAL); @@ -495,9 +495,9 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // if this is our first position, publish immediately if (!this.lastPublishedPositionTimestamp) { - this.publishLocationToBeacons(timedGeoPosition); + void this.publishLocationToBeacons(timedGeoPosition); } else { - this.debouncedPublishLocationToBeacons(timedGeoPosition); + void this.debouncedPublishLocationToBeacons(timedGeoPosition); } }; @@ -524,10 +524,10 @@ export class OwnBeaconStore extends AsyncStoreWithClient { private publishCurrentLocationToBeacons = async (): Promise => { try { const position = await getCurrentPosition(); - this.publishLocationToBeacons(mapGeolocationPositionToTimedGeo(position)); + await this.publishLocationToBeacons(mapGeolocationPositionToTimedGeo(position)); } catch (error) { if (error instanceof Error) { - this.onGeolocationError(error.message as GeolocationError); + await this.onGeolocationError(error.message as GeolocationError); } else { console.error("Unexpected error", error); } diff --git a/apps/web/src/stores/OwnProfileStore.ts b/apps/web/src/stores/OwnProfileStore.ts index 3b1647ab8a..fcbd9b4afe 100644 --- a/apps/web/src/stores/OwnProfileStore.ts +++ b/apps/web/src/stores/OwnProfileStore.ts @@ -40,7 +40,7 @@ const KEY_AVATAR_URL = "mx_profile_avatar_url"; export class OwnProfileStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new OwnProfileStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/RoomViewStore.tsx b/apps/web/src/stores/RoomViewStore.tsx index 5604fb3936..2ea8d532fd 100644 --- a/apps/web/src/stores/RoomViewStore.tsx +++ b/apps/web/src/stores/RoomViewStore.tsx @@ -220,7 +220,7 @@ export class RoomViewStore extends EventEmitter { // - event_offset: 100 // - highlighted: true case Action.ViewRoom: - this.viewRoom(payload as ViewRoomPayload); + void this.viewRoom(payload as ViewRoomPayload); break; case Action.ViewThread: this.viewThread(payload as ThreadPayload); @@ -252,7 +252,7 @@ export class RoomViewStore extends EventEmitter { // join_room: // - opts: options for joinRoom case Action.JoinRoom: - this.joinRoom(payload as JoinRoomPayload); + void this.joinRoom(payload as JoinRoomPayload); break; case Action.JoinRoomError: this.joinRoomError(payload as JoinRoomErrorPayload); @@ -262,7 +262,7 @@ export class RoomViewStore extends EventEmitter { this.setState({ shouldPeek: false }); } - awaitRoomDownSync(MatrixClientPeg.safeGet(), payload.roomId).then((room) => { + void awaitRoomDownSync(MatrixClientPeg.safeGet(), payload.roomId).then((room) => { const numMembers = room.getJoinedMemberCount(); const roomSize = numMembers > 1000 @@ -390,7 +390,7 @@ export class RoomViewStore extends EventEmitter { // Immediately start the call. This will connect to all required widget events // and allow the widget to show the lobby. if (call.connectionState === ConnectionState.Disconnected) { - call.start({ skipLobby: payload.skipLobby, voiceOnly: payload.voiceOnly }); + void call.start({ skipLobby: payload.skipLobby, voiceOnly: payload.voiceOnly }); } } // If we switch to a different room from the call, we are no longer presenting it diff --git a/apps/web/src/stores/SetupEncryptionStore.ts b/apps/web/src/stores/SetupEncryptionStore.ts index 5815782d8e..ec55fd5ea5 100644 --- a/apps/web/src/stores/SetupEncryptionStore.ts +++ b/apps/web/src/stores/SetupEncryptionStore.ts @@ -69,10 +69,10 @@ export class SetupEncryptionStore extends EventEmitter { // If there are multiple, we take the most recent. Equally if the user sends another request from // another device after this screen has been shown, we'll switch to the new one, so this // generally doesn't support multiple requests. - this.setActiveVerificationRequest(requestsInProgress[requestsInProgress.length - 1]); + void this.setActiveVerificationRequest(requestsInProgress[requestsInProgress.length - 1]); } - this.fetchKeyInfo(); + void this.fetchKeyInfo(); } public stop(): void { @@ -174,7 +174,7 @@ export class SetupEncryptionStore extends EventEmitter { }; public onVerificationRequest = (request: VerificationRequest): void => { - this.setActiveVerificationRequest(request); + void this.setActiveVerificationRequest(request); }; public onVerificationRequestChange = async (): Promise => { diff --git a/apps/web/src/stores/TypingStore.ts b/apps/web/src/stores/TypingStore.ts index 2796cc2293..0d7986a102 100644 --- a/apps/web/src/stores/TypingStore.ts +++ b/apps/web/src/stores/TypingStore.ts @@ -77,7 +77,7 @@ export default class TypingStore { if (isTyping) { if (!currentTyping.serverTimer.isRunning()) { - currentTyping.serverTimer + void currentTyping.serverTimer .restart() .finished() .then(() => { @@ -90,7 +90,7 @@ export default class TypingStore { } else currentTyping.serverTimer.restart(); if (!currentTyping.userTimer.isRunning()) { - currentTyping.userTimer + void currentTyping.userTimer .restart() .finished() .then(() => { @@ -99,6 +99,6 @@ export default class TypingStore { } else currentTyping.userTimer.restart(); } - this.context.client?.sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT); + void this.context.client?.sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT); } } diff --git a/apps/web/src/stores/VoiceRecordingStore.ts b/apps/web/src/stores/VoiceRecordingStore.ts index 5991c689d6..a67589ae56 100644 --- a/apps/web/src/stores/VoiceRecordingStore.ts +++ b/apps/web/src/stores/VoiceRecordingStore.ts @@ -29,7 +29,7 @@ export class VoiceRecordingStore extends AsyncStoreWithClient { public static get instance(): VoiceRecordingStore { if (!this.internalInstance) { this.internalInstance = new VoiceRecordingStore(); - this.internalInstance.start(); + void this.internalInstance.start(); } return this.internalInstance; } @@ -70,8 +70,7 @@ export class VoiceRecordingStore extends AsyncStoreWithClient { const recording = createVoiceMessageRecording(this.matrixClient); - // noinspection JSIgnoredPromiseFromCall - we can safely run this async - this.updateState({ ...this.state, [voiceRecordingId]: recording }); + void this.updateState({ ...this.state, [voiceRecordingId]: recording }); return recording; } diff --git a/apps/web/src/stores/WidgetStore.ts b/apps/web/src/stores/WidgetStore.ts index b41c101ac6..c00ecbe666 100644 --- a/apps/web/src/stores/WidgetStore.ts +++ b/apps/web/src/stores/WidgetStore.ts @@ -37,7 +37,7 @@ interface IRoomWidgets { export default class WidgetStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new WidgetStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/local-echo/EchoStore.ts b/apps/web/src/stores/local-echo/EchoStore.ts index 90a52f6cac..ba854e0324 100644 --- a/apps/web/src/stores/local-echo/EchoStore.ts +++ b/apps/web/src/stores/local-echo/EchoStore.ts @@ -38,7 +38,7 @@ export class EchoStore extends AsyncStoreWithClient { public static get instance(): EchoStore { if (!this._instance) { this._instance = new EchoStore(); - this._instance.start(); + void this._instance.start(); } return this._instance; } diff --git a/apps/web/src/stores/message-preview/MessagePreviewStore.ts b/apps/web/src/stores/message-preview/MessagePreviewStore.ts index 0f9b074757..fd12a09fb8 100644 --- a/apps/web/src/stores/message-preview/MessagePreviewStore.ts +++ b/apps/web/src/stores/message-preview/MessagePreviewStore.ts @@ -82,7 +82,7 @@ const mkMessagePreview = (text: string, event: MatrixEvent): MessagePreview => { export class MessagePreviewStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new MessagePreviewStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/notifications/RoomNotificationStateStore.ts b/apps/web/src/stores/notifications/RoomNotificationStateStore.ts index 2ab82cf8ba..a9697d7c8e 100644 --- a/apps/web/src/stores/notifications/RoomNotificationStateStore.ts +++ b/apps/web/src/stores/notifications/RoomNotificationStateStore.ts @@ -24,7 +24,7 @@ export const UPDATE_STATUS_INDICATOR = Symbol("update-status-indicator"); export class RoomNotificationStateStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new RoomNotificationStateStore(); - instance.start(); + void instance.start(); return instance; })(); private roomMap = new Map(); diff --git a/apps/web/src/stores/right-panel/RightPanelStore.ts b/apps/web/src/stores/right-panel/RightPanelStore.ts index 58f7f2357a..c077dba223 100644 --- a/apps/web/src/stores/right-panel/RightPanelStore.ts +++ b/apps/web/src/stores/right-panel/RightPanelStore.ts @@ -315,13 +315,13 @@ export default class RightPanelStore extends ReadyWatchingStore { private emitAndUpdateSettings(): void { this.filterValidCards(this.global); const storePanelGlobal = convertToStorePanel(this.global); - SettingsStore.setValue("RightPanel.phasesGlobal", null, SettingLevel.DEVICE, storePanelGlobal); + void SettingsStore.setValue("RightPanel.phasesGlobal", null, SettingLevel.DEVICE, storePanelGlobal); if (!!this.viewedRoomId) { const panelThisRoom = this.byRoom[this.viewedRoomId]; this.filterValidCards(panelThisRoom); const storePanelThisRoom = convertToStorePanel(panelThisRoom); - SettingsStore.setValue( + void SettingsStore.setValue( "RightPanel.phases", this.viewedRoomId, SettingLevel.ROOM_DEVICE, @@ -449,7 +449,7 @@ export default class RightPanelStore extends ReadyWatchingStore { public static get instance(): RightPanelStore { if (!this.internalInstance) { this.internalInstance = new RightPanelStore(); - this.internalInstance.start(); + void this.internalInstance.start(); } return this.internalInstance; } diff --git a/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts b/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts index c87e9f7bd5..dd0bbebe11 100644 --- a/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts +++ b/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts @@ -222,7 +222,7 @@ export class RoomListStoreV3Class extends AsyncStoreWithClient { const sorter = this.getSorterFromSortingAlgorithm(algorithm, this.matrixClient.getSafeUserId()); this.roomSkipList.useNewSorter(sorter, this.getRooms()); this.emit(LISTS_UPDATE_EVENT); - SettingsStore.setValue("RoomList.preferredSorting", null, SettingLevel.DEVICE, algorithm); + void SettingsStore.setValue("RoomList.preferredSorting", null, SettingLevel.DEVICE, algorithm); } /** @@ -589,7 +589,7 @@ export default class RoomListStoreV3 { public static get instance(): RoomListStoreV3Class { if (!RoomListStoreV3.internalInstance) { const instance = new RoomListStoreV3Class(defaultDispatcher); - instance.start(); + void instance.start(); RoomListStoreV3.internalInstance = instance; } diff --git a/apps/web/src/stores/spaces/SpaceStore.ts b/apps/web/src/stores/spaces/SpaceStore.ts index 6976d2f265..539a11e5da 100644 --- a/apps/web/src/stores/spaces/SpaceStore.ts +++ b/apps/web/src/stores/spaces/SpaceStore.ts @@ -282,14 +282,14 @@ export default class SpaceStore extends AsyncStoreWithClient { this.emit(UPDATE_SUGGESTED_ROOMS, (this._suggestedRooms = [])); if (cliSpace) { - this.loadSuggestedRooms(cliSpace); + void this.loadSuggestedRooms(cliSpace); // Load all members for the selected space and its subspaces, // so we can correctly show DMs we have with members of this space. this.traverseSpace( space, (roomId) => { - this.matrixClient?.getRoom(roomId)?.loadMembersIfNeeded(); + void this.matrixClient?.getRoom(roomId)?.loadMembersIfNeeded(); }, false, ); @@ -995,7 +995,7 @@ export default class SpaceStore extends AsyncStoreWithClient { target?.getMyMembership() !== KnownMembership.Join && // target not joined ev.getPrevContent().suggested !== ev.getContent().suggested // suggested flag changed ) { - this.loadSuggestedRooms(room); + void this.loadSuggestedRooms(room); } break; @@ -1346,7 +1346,7 @@ export default class SpaceStore extends AsyncStoreWithClient { const changes = reorderLexicographically(currentOrders, fromIndex, toIndex); changes.forEach(({ index, order }) => { - this.setRootSpaceOrder(this.rootSpaces[index], order); + void this.setRootSpaceOrder(this.rootSpaces[index], order); }); this.notifyIfOrderChanged(); diff --git a/apps/web/src/stores/widgets/WidgetLayoutStore.ts b/apps/web/src/stores/widgets/WidgetLayoutStore.ts index f2b7144f70..5cac077fc0 100644 --- a/apps/web/src/stores/widgets/WidgetLayoutStore.ts +++ b/apps/web/src/stores/widgets/WidgetLayoutStore.ts @@ -60,7 +60,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore { public static get instance(): WidgetLayoutStore { if (!this.internalInstance) { this.internalInstance = new WidgetLayoutStore(); - this.internalInstance.start(); + void this.internalInstance.start(); } return this.internalInstance; } @@ -472,7 +472,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore { }; } } - this.matrixClient?.sendStateEvent(room.roomId, WIDGET_LAYOUT_EVENT_TYPE, evContent, ""); + void this.matrixClient?.sendStateEvent(room.roomId, WIDGET_LAYOUT_EVENT_TYPE, evContent, ""); } private getAllWidgets(room: Room): [IApp, Container][] { diff --git a/apps/web/src/stores/widgets/WidgetMessaging.ts b/apps/web/src/stores/widgets/WidgetMessaging.ts index bf7cb46db3..7962a327f4 100644 --- a/apps/web/src/stores/widgets/WidgetMessaging.ts +++ b/apps/web/src/stores/widgets/WidgetMessaging.ts @@ -271,7 +271,7 @@ export class WidgetMessaging extends TypedEventEmitter { - this.widgetApi?.updateTheme({ name: theme }); + void this.widgetApi?.updateTheme({ name: theme }); }; private onOpenModal = async (ev: CustomEvent): Promise => { @@ -437,8 +437,9 @@ export class WidgetMessaging extends TypedEventEmitter { - this.client.decryptEventIfNeeded(ev); + void this.client.decryptEventIfNeeded(ev); this.feedEvent(ev); }; diff --git a/apps/web/src/stores/widgets/WidgetMessagingStore.ts b/apps/web/src/stores/widgets/WidgetMessagingStore.ts index a9ec3d765f..21c12ff62d 100644 --- a/apps/web/src/stores/widgets/WidgetMessagingStore.ts +++ b/apps/web/src/stores/widgets/WidgetMessagingStore.ts @@ -29,7 +29,7 @@ export enum WidgetMessagingStoreEvent { export class WidgetMessagingStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new WidgetMessagingStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/widgets/WidgetPermissionStore.ts b/apps/web/src/stores/widgets/WidgetPermissionStore.ts index 026438e1c4..d8d5dac22c 100644 --- a/apps/web/src/stores/widgets/WidgetPermissionStore.ts +++ b/apps/web/src/stores/widgets/WidgetPermissionStore.ts @@ -69,6 +69,6 @@ export class WidgetPermissionStore { currentValues.deny = currentValues.deny.filter((c) => c !== settingsKey); } - SettingsStore.setValue("widgetOpenIDPermissions", null, SettingLevel.DEVICE, currentValues); + void SettingsStore.setValue("widgetOpenIDPermissions", null, SettingLevel.DEVICE, currentValues); } } diff --git a/apps/web/src/toasts/AnalyticsToast.tsx b/apps/web/src/toasts/AnalyticsToast.tsx index 40d4643e93..7e50611f7b 100644 --- a/apps/web/src/toasts/AnalyticsToast.tsx +++ b/apps/web/src/toasts/AnalyticsToast.tsx @@ -38,7 +38,7 @@ const onLearnMoreNoOptIn = (): void => { primaryButton: _t("action|enable"), }); - finished.then(([buttonClicked]) => { + void finished.then(([buttonClicked]) => { if (buttonClicked === ButtonClicked.Primary) { // user clicked "Enable" onAccept(); @@ -54,7 +54,7 @@ const onLearnMorePreviouslyOptedIn = (): void => { cancelButton: _t("action|stop"), }); - finished.then(([buttonClicked]) => { + void finished.then(([buttonClicked]) => { if (buttonClicked === ButtonClicked.Primary) { // user clicked "That's fine" onAccept(); diff --git a/apps/web/src/toasts/DesktopNotificationsToast.ts b/apps/web/src/toasts/DesktopNotificationsToast.ts index fb9dd4ec1a..b6a8e6597f 100644 --- a/apps/web/src/toasts/DesktopNotificationsToast.ts +++ b/apps/web/src/toasts/DesktopNotificationsToast.ts @@ -22,7 +22,7 @@ export const showToast = (notifier: Notifier, fromMessageSend: boolean): void => await SettingsStore.setValue("notificationsEnabled", null, SettingLevel.DEVICE, true); const cli = MatrixClientPeg.safeGet(); const eventType = getLocalNotificationAccountDataEventType(cli.deviceId); - cli.setAccountData(eventType, { + await cli.setAccountData(eventType, { is_silenced: false, }); }; diff --git a/apps/web/src/toasts/UpdateToast.tsx b/apps/web/src/toasts/UpdateToast.tsx index 4ced8144c1..46600e300f 100644 --- a/apps/web/src/toasts/UpdateToast.tsx +++ b/apps/web/src/toasts/UpdateToast.tsx @@ -37,7 +37,7 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st description:
{releaseNotes}
, button: _t("action|update"), }); - finished.then(([update]) => { + void finished.then(([update]) => { if (update && PlatformPeg.get()) { PlatformPeg.get()!.installUpdate(); } @@ -49,7 +49,7 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st version, newVersion, }); - finished.then(([update]) => { + void finished.then(([update]) => { if (update && PlatformPeg.get()) { PlatformPeg.get()!.installUpdate(); } diff --git a/apps/web/src/utils/DMRoomMap.ts b/apps/web/src/utils/DMRoomMap.ts index 3153ed88fa..e889babf30 100644 --- a/apps/web/src/utils/DMRoomMap.ts +++ b/apps/web/src/utils/DMRoomMap.ts @@ -231,7 +231,7 @@ export default class DMRoomMap { logger.warn(`Invalid m.direct account data detected (self-chats that shouldn't be), patching it up.`); if (neededPatching && !this.hasSentOutPatchDirectAccountDataPatch) { this.hasSentOutPatchDirectAccountDataPatch = true; - this.matrixClient.setAccountData(EventType.Direct, userToRooms); + void this.matrixClient.setAccountData(EventType.Direct, userToRooms); } } this.userToRooms = userToRooms; diff --git a/apps/web/src/utils/DialogOpener.ts b/apps/web/src/utils/DialogOpener.ts index 1130245fff..1e6a540437 100644 --- a/apps/web/src/utils/DialogOpener.ts +++ b/apps/web/src/utils/DialogOpener.ts @@ -104,7 +104,7 @@ export class DialogOpener { ); break; case Action.OpenInviteDialog: - Modal.createDialog( + void Modal.createDialog( InviteDialog, { kind: payload.kind, @@ -124,7 +124,7 @@ export class DialogOpener { AddExistingToSpaceDialog, { onCreateRoomClick: (ev: ButtonEvent) => { - showCreateNewRoom(space); + void showCreateNewRoom(space); PosthogTrackers.trackInteraction("WebAddExistingToSpaceDialogCreateRoomButton", ev); }, onAddSubspaceClick: () => showAddExistingSubspace(space), @@ -132,7 +132,7 @@ export class DialogOpener { }, "mx_AddExistingToSpaceDialog_wrapper", ); - finished.then(([added]) => { + void finished.then(([added]) => { if (added && SDKContextClass.instance.roomViewStore.getRoomId() === space.roomId) { defaultDispatcher.fire(Action.UpdateSpaceHierarchy); } diff --git a/apps/web/src/utils/IdentityServerUtils.ts b/apps/web/src/utils/IdentityServerUtils.ts index df4f269c34..b3f154594b 100644 --- a/apps/web/src/utils/IdentityServerUtils.ts +++ b/apps/web/src/utils/IdentityServerUtils.ts @@ -18,7 +18,7 @@ export function getDefaultIdentityServerUrl(): string | undefined { export function setToDefaultIdentityServer(matrixClient: MatrixClient): void { const url = getDefaultIdentityServerUrl(); // Account data change will update localstorage, client, etc through dispatcher - matrixClient.setAccountData("m.identity_server", { + void matrixClient.setAccountData("m.identity_server", { base_url: url ?? null, }); } diff --git a/apps/web/src/utils/MultiInviter.ts b/apps/web/src/utils/MultiInviter.ts index d01f68d5a8..b263c4e5e7 100644 --- a/apps/web/src/utils/MultiInviter.ts +++ b/apps/web/src/utils/MultiInviter.ts @@ -383,7 +383,7 @@ export default class MultiInviter { return new Promise((resolve) => { const inviteUnknowns = (): void => { const promises = unknownProfileUsers.map((u) => this.doInvite(u, true)); - Promise.all(promises).then(() => resolve()); + void Promise.all(promises).then(() => resolve()); }; if (!SettingsStore.getValue("promptBeforeInviteUnknownUsers", this.roomId)) { diff --git a/apps/web/src/utils/WidgetUtils.ts b/apps/web/src/utils/WidgetUtils.ts index 624ff0e753..d651093d38 100644 --- a/apps/web/src/utils/WidgetUtils.ts +++ b/apps/web/src/utils/WidgetUtils.ts @@ -534,8 +534,7 @@ export default class WidgetUtils { } public static editWidget(room: Room, app: IWidget): void { - // noinspection JSIgnoredPromiseFromCall - IntegrationManagers.sharedInstance() + void IntegrationManagers.sharedInstance() .getPrimaryManager() ?.open(room, "type_" + app.type, app.id); } diff --git a/apps/web/src/utils/device/clientInformation.ts b/apps/web/src/utils/device/clientInformation.ts index 3c2fb544bd..2290f1a4b3 100644 --- a/apps/web/src/utils/device/clientInformation.ts +++ b/apps/web/src/utils/device/clientInformation.ts @@ -68,7 +68,7 @@ export const pruneClientInformation = (validDeviceIds: string[], matrixClient: M } const [, deviceId] = event.getType().split(clientInformationEventPrefix); if (deviceId && !validDeviceIds.includes(deviceId)) { - matrixClient.deleteAccountData(event.getType() as keyof AccountDataEvents); + void matrixClient.deleteAccountData(event.getType() as keyof AccountDataEvents); } }); }; diff --git a/apps/web/src/utils/dm/createDmLocalRoom.ts b/apps/web/src/utils/dm/createDmLocalRoom.ts index e29d808ff5..f38ae6aa3b 100644 --- a/apps/web/src/utils/dm/createDmLocalRoom.ts +++ b/apps/web/src/utils/dm/createDmLocalRoom.ts @@ -109,7 +109,7 @@ export async function createDmLocalRoom(client: MatrixClient, targets: Member[]) localRoom.targets = targets; localRoom.updateMyMembership(KnownMembership.Join); - localRoom.addLiveEvents(events, { addToState: true }); + void localRoom.addLiveEvents(events, { addToState: true }); localRoom.currentState.setStateEvents(events); localRoom.name = localRoom.getDefaultRoomName(client.getUserId()!); client.store.storeRoom(localRoom); diff --git a/apps/web/src/utils/leave-behaviour.ts b/apps/web/src/utils/leave-behaviour.ts index ddbcd47623..2c9b525299 100644 --- a/apps/web/src/utils/leave-behaviour.ts +++ b/apps/web/src/utils/leave-behaviour.ts @@ -196,7 +196,7 @@ export const leaveSpace = (space: Room): void => { }, "mx_LeaveSpaceDialog_wrapper", ); - finished.then(async ([leave, rooms]) => { + void finished.then(async ([leave, rooms]) => { if (!leave) return; await bulkSpaceBehaviour(space, rooms!, (room) => leaveRoomBehaviour(space.client, room.roomId)); diff --git a/apps/web/src/utils/promise.ts b/apps/web/src/utils/promise.ts index 919b925a5b..51c93c5364 100644 --- a/apps/web/src/utils/promise.ts +++ b/apps/web/src/utils/promise.ts @@ -11,7 +11,7 @@ Please see LICENSE files in the repository root for full details. export async function timeout(promise: Promise, timeoutValue: Y, ms: number): Promise { const timeoutPromise = new Promise((resolve) => { const timeoutId = window.setTimeout(resolve, ms, timeoutValue); - promise.then(() => { + void promise.then(() => { clearTimeout(timeoutId); }); }); diff --git a/apps/web/src/utils/space.tsx b/apps/web/src/utils/space.tsx index a794c6c050..d153f3db8b 100644 --- a/apps/web/src/utils/space.tsx +++ b/apps/web/src/utils/space.tsx @@ -114,7 +114,7 @@ export const showAddExistingSubspace = (space: Room): void => { }, "mx_AddExistingToSpaceDialog_wrapper", ); - finished.then(([added]) => { + void finished.then(([added]) => { if (added && SDKContextClass.instance.roomViewStore.getRoomId() === space.roomId) { defaultDispatcher.fire(Action.UpdateSpaceHierarchy); } @@ -130,7 +130,7 @@ export const showCreateNewSubspace = (space: Room): void => { }, "mx_CreateSubspaceDialog_wrapper", ); - finished.then(([added]) => { + void finished.then(([added]) => { if (added && SDKContextClass.instance.roomViewStore.getRoomId() === space.roomId) { defaultDispatcher.fire(Action.UpdateSpaceHierarchy); } diff --git a/apps/web/src/vector/jitsi/index.ts b/apps/web/src/vector/jitsi/index.ts index 09e1e8bc34..f60a69be39 100644 --- a/apps/web/src/vector/jitsi/index.ts +++ b/apps/web/src/vector/jitsi/index.ts @@ -496,7 +496,6 @@ const onVideoConferenceJoined = (): void => { if (widgetApi) { // ignored promise because we don't care if it works - // noinspection JSIgnoredPromiseFromCall void widgetApi.setAlwaysOnScreen(true); void widgetApi.transport.send(ElementWidgetActions.JoinCall, {}); } diff --git a/apps/web/src/viewmodels/menus/UserMenuViewModel.ts b/apps/web/src/viewmodels/menus/UserMenuViewModel.ts index a94d5c4308..83bea4ef2a 100644 --- a/apps/web/src/viewmodels/menus/UserMenuViewModel.ts +++ b/apps/web/src/viewmodels/menus/UserMenuViewModel.ts @@ -83,7 +83,7 @@ export class UserMenuViewModel super(props, UserMenuViewModel.computeSnapshot(client, props.ownProfileStore, isPanelCollapsed)); this.setStatusVm = new UserMenuSetStatusViewModel({ client, ownProfileStore: props.ownProfileStore }); props.ownProfileStore.on(UPDATE_EVENT, this.recalculateProfile); - this.loadAuthMetadata(); + void this.loadAuthMetadata(); } public dispose(): void { diff --git a/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts b/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts index d5033d3742..31c117ad66 100644 --- a/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts +++ b/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts @@ -49,8 +49,7 @@ async function cacheDownloadIcon(): Promise { } // Cache the asset immediately -// noinspection JSIgnoredPromiseFromCall -cacheDownloadIcon(); +void cacheDownloadIcon(); // User supplied content can contain scripts, we have to be careful that // we don't accidentally run those script within the same origin as the @@ -223,7 +222,7 @@ export class FileBodyViewModel private downloadFile(fileName: string, text: string): void { if (!this.decryptedBlob) return; - this.fileDownloader.download({ + void this.fileDownloader.download({ blob: this.decryptedBlob, name: fileName, autoDownload: this.userDidClick, @@ -264,7 +263,7 @@ export class FileBodyViewModel return; } - this.fileDownloader.download({ + await this.fileDownloader.download({ blob: await this.props.mediaEventHelper.sourceBlob.value, name: this.fileName, }); @@ -281,7 +280,7 @@ export class FileBodyViewModel const fileType = this.content.info?.mimetype ?? "application/octet-stream"; logger.log(`Downloading ${fileType} as blob (unencrypted)`); - this.props.mediaEventHelper.sourceBlob.value.then((blob) => { + void this.props.mediaEventHelper.sourceBlob.value.then((blob) => { const blobUrl = URL.createObjectURL(blob); const tempAnchor = document.createElement("a"); tempAnchor.download = this.fileName; diff --git a/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts b/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts index e320d939c9..f70f477275 100644 --- a/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts +++ b/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts @@ -521,7 +521,7 @@ export class VideoBodyViewModel fetchingData: false, }; this.updateSnapshotFromState(); - this.props.videoRef.current?.play(); + void this.props.videoRef.current?.play(); } catch (error) { if ( this.isDisposed || diff --git a/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts b/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts index 017a16a068..84779b7495 100644 --- a/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts +++ b/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts @@ -155,7 +155,7 @@ export class RoomListHeaderViewModel }; public createRoom = (e: Event): void => { - createRoom(this.activeSpace); + void createRoom(this.activeSpace); PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuCreateRoomItem", e); }; @@ -164,7 +164,7 @@ export class RoomListHeaderViewModel ? RoomType.UnstableCall : RoomType.ElementVideo; if (this.activeSpace) { - showCreateNewRoom(this.activeSpace, type); + void showCreateNewRoom(this.activeSpace, type); } else { defaultDispatcher.dispatch({ action: Action.CreateRoom, @@ -224,12 +224,12 @@ export class RoomListHeaderViewModel PosthogTrackers.trackInteraction("WebRoomListMessagePreviewToggle"); const isMessagePreviewEnabled = !SettingsStore.getValue("RoomList.showMessagePreview"); - SettingsStore.setValue("RoomList.showMessagePreview", null, SettingLevel.DEVICE, isMessagePreviewEnabled); + void SettingsStore.setValue("RoomList.showMessagePreview", null, SettingLevel.DEVICE, isMessagePreviewEnabled); this.snapshot.merge({ isMessagePreviewEnabled }); }; public createSection = (): void => { - RoomListStoreV3.instance.createSection(); + void RoomListStoreV3.instance.createSection(); PosthogTrackers.trackSectionCreation("RoomListHeader"); }; @@ -254,7 +254,7 @@ export class RoomListHeaderViewModel }; public closeSectionReleaseAnnouncement = (): void => { - ReleaseAnnouncementStore.instance.nextReleaseAnnouncement(); + void ReleaseAnnouncementStore.instance.nextReleaseAnnouncement(); this.snapshot.merge({ displaySectionReleaseAnnouncement: false }); }; diff --git a/apps/web/src/viewmodels/room-list/RoomListViewModel.ts b/apps/web/src/viewmodels/room-list/RoomListViewModel.ts index d17d88c3a1..52962ba776 100644 --- a/apps/web/src/viewmodels/room-list/RoomListViewModel.ts +++ b/apps/web/src/viewmodels/room-list/RoomListViewModel.ts @@ -260,7 +260,7 @@ export class RoomListViewModel // Update roomsMap immediately before clearing VMs this.updateRoomsMap(this.roomsResult); - this.updateRoomListData(); + void this.updateRoomListData(); }; /** @@ -274,7 +274,7 @@ export class RoomListViewModel this.roomsResult = RoomListStoreV3.instance.getSortedRoomsInActiveSpace(); this.updateRoomsMap(this.roomsResult); this.snapshot.merge({ filterIds: getVisibleFilterIds() }); - this.updateRoomListData(); + void this.updateRoomListData(); }; /** @@ -534,7 +534,7 @@ export class RoomListViewModel if (payload.action === Action.ActiveRoomChanged) { // When the active room changes, update the room list data to reflect the new selected room // Pass isRoomChange=true so sticky logic doesn't prevent the index from updating - this.updateRoomListData(true); + void this.updateRoomListData(true); } else if (payload.action === Action.ViewRoomDelta) { // Handle keyboard navigation shortcuts (Alt+ArrowUp/Down) // This was previously handled by useRoomListNavigation hook @@ -556,7 +556,7 @@ export class RoomListViewModel for (const sectionHeaderVM of this.roomSectionHeaderViewModels.values()) { sectionHeaderVM.isExpanded = expand; } - this.updateRoomListData(); + void this.updateRoomListData(); } /** @@ -638,14 +638,14 @@ export class RoomListViewModel // Space changed - get the last selected room for the new space to prevent flicker const lastSelectedRoom = this.props.spaceStore.getLastSelectedRoomIdForSpace(newSpaceId); - this.updateRoomListData(true, lastSelectedRoom); + void this.updateRoomListData(true, lastSelectedRoom); return; } this.updateRoomsMap(this.roomsResult); // Normal room list update (not a space change) - this.updateRoomListData(); + void this.updateRoomListData(); }; private onListsLoaded = (): void => { @@ -863,7 +863,7 @@ export class RoomListViewModel const filterKeys = this.activeFilter !== undefined ? [this.activeFilter] : undefined; this.roomsResult = RoomListStoreV3.instance.getSortedRoomsInActiveSpace(filterKeys); this.updateRoomsMap(this.roomsResult); - this.updateRoomListData(false, null, tag); + void this.updateRoomListData(false, null, tag); this.showToast("section_created"); }; @@ -910,7 +910,7 @@ export class RoomListViewModel const filterKeys = this.activeFilter !== undefined ? [this.activeFilter] : undefined; this.roomsResult = RoomListStoreV3.instance.getSortedRoomsInActiveSpace(filterKeys); this.updateRoomsMap(this.roomsResult); - this.updateRoomListData(false, null, sourceTag); + void this.updateRoomListData(false, null, sourceTag); }; public onSectionDragStart = (): void => { @@ -919,7 +919,7 @@ export class RoomListViewModel this.savedExpansionStates.set(tag, sectionVM.isExpanded); sectionVM.isExpanded = false; } - this.updateRoomListData(); + void this.updateRoomListData(); }; public onSectionDragEnd = (): void => { @@ -928,7 +928,7 @@ export class RoomListViewModel if (sectionVM) sectionVM.isExpanded = expanded; } this.savedExpansionStates.clear(); - this.updateRoomListData(); + void this.updateRoomListData(); }; public changeRoomSection = (roomId: string, tag: string): void => { diff --git a/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts b/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts index ab6dacde49..278d81307a 100644 --- a/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts +++ b/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts @@ -265,7 +265,7 @@ export class EventTileActionBarViewModel this.addListenerCleanup(() => roomState.off(RoomStateEvent.Events, this.onRoomEvent)); } - MatrixClientPeg.safeGet().decryptEventIfNeeded(mxEvent); + void MatrixClientPeg.safeGet().decryptEventIfNeeded(mxEvent); void this.updateDownloadPermission(++this.downloadPermissionRequestId); } diff --git a/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx b/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx index dd0ca4a0a5..1cf6eb6e1e 100644 --- a/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx +++ b/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx @@ -190,7 +190,7 @@ export class RoomUploadViewModel if (![TimelineRenderingType.Room, TimelineRenderingType.Thread].includes(this.timelineRenderingType)) { throw new Error("TimelineRenderingType must be Room or Thread"); } - fn( + void fn( this.room.roomId, { view: this.timelineRenderingType === TimelineRenderingType.Room ? "room" : "thread", @@ -295,7 +295,7 @@ export function RoomUploadContextProvider({ timelineRenderingType, threadRelation, ); - vm.initiateViaInputFiles(fileInsert.files); + void vm.initiateViaInputFiles(fileInsert.files); } }); diff --git a/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx b/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx index 389d26e7df..16652e7152 100644 --- a/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx +++ b/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx @@ -163,9 +163,9 @@ export class WidgetContextMenuViewModel button: _t("widget|context_menu|delete"), }); - finished.then(([confirmed]) => { + void finished.then(([confirmed]) => { if (!confirmed) return; - WidgetUtils.setRoomWidget(this._cli, this._roomId!, this._app.id); + void WidgetUtils.setRoomWidget(this._cli, this._roomId!, this._app.id); }); } diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts index e114cf8ee6..e1e5eab053 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts @@ -83,7 +83,7 @@ export class AudioPlayerViewModel // Don't wait for the promise to complete - it will emit a progress update when it // is done, and it's not meant to take long anyhow. - this.preparePlayback(); + void this.preparePlayback(); } /** @@ -113,13 +113,13 @@ export class AudioPlayerViewModel switch (action) { case KeyBindingAction.Space: - this.togglePlay(); + void this.togglePlay(); break; case KeyBindingAction.ArrowLeft: - this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS); + void this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS); break; case KeyBindingAction.ArrowRight: - this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS); + void this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS); break; default: handled = false; diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx b/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx index 1fca14c81f..6dde1ec8ec 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx +++ b/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx @@ -308,7 +308,7 @@ export class TextualBodyViewModel const integrationManager = managers.getPrimaryManager(); const scalarClient = integrationManager?.getScalarClient(); - scalarClient?.connect().then(() => { + void scalarClient?.connect().then(() => { const completeUrl = scalarClient.getStarterLink(starterLink); const integrationsUrl = integrationManager!.uiUrl; const { finished } = Modal.createDialog(QuestionDialog, { @@ -317,7 +317,7 @@ export class TextualBodyViewModel button: _t("action|continue"), }); - finished.then(([confirmed]) => { + return finished.then(([confirmed]) => { if (!confirmed) { return; } diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts index d574ee1572..515fabd743 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts @@ -91,7 +91,7 @@ export class ViewSourceEventViewModel this.removeDecryptionListener(); const { cli, mxEvent } = this.props; - cli.decryptEventIfNeeded(mxEvent); + void cli.decryptEventIfNeeded(mxEvent); if (!mxEvent.isBeingDecrypted()) return; diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.ts index 6833663223..8e5fc42cfa 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.ts @@ -172,7 +172,7 @@ export class BaseOngoingCallViewModel< } const callType = getIntentFromEvent(this.props.mxEvent); const type = callType === SharedComponentsCallType.Voice ? CallType.Voice : CallType.Video; - placeCall( + void placeCall( this.props.legacyCallHandler, room, type, diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts index 591a9073c7..affb3a7e8c 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts @@ -195,11 +195,11 @@ export class ReactionsRowButtonViewModel if (disabled) return; if (myReactionEvent) { - client.redactEvent(mxEvent.getRoomId()!, myReactionEvent.getId()!); + void client.redactEvent(mxEvent.getRoomId()!, myReactionEvent.getId()!); return; } - client.sendEvent(mxEvent.getRoomId()!, EventType.Reaction, { + void client.sendEvent(mxEvent.getRoomId()!, EventType.Reaction, { "m.relates_to": { rel_type: RelationType.Annotation, event_id: mxEvent.getId()!, diff --git a/apps/web/src/viewmodels/structures/ResizerViewModel.ts b/apps/web/src/viewmodels/structures/ResizerViewModel.ts index bf41469236..a5a79149e4 100644 --- a/apps/web/src/viewmodels/structures/ResizerViewModel.ts +++ b/apps/web/src/viewmodels/structures/ResizerViewModel.ts @@ -103,13 +103,13 @@ export class ResizerViewModel const isCollapsed = newSize === 0; // Store the size if the panel isn't collapsed. if (!isCollapsed) { - SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, newSize); + void SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, newSize); } // Store whether the panel was collapsed. // This is stored separately instead of being inferred from the stored panel size so that // the panel can be restored to its last known non-zero width even after app reload, which // we wouldn't be able to do if we stored panelSize as zero. - SettingsStore.setValue("RoomList.isPanelCollapsed", null, SettingLevel.DEVICE, isCollapsed); + void SettingsStore.setValue("RoomList.isPanelCollapsed", null, SettingLevel.DEVICE, isCollapsed); }; public setPanelHandle = (handle: PanelImperativeHandle): void => { diff --git a/apps/web/src/widgets/Jitsi.ts b/apps/web/src/widgets/Jitsi.ts index c3eecb6a5c..953732255e 100644 --- a/apps/web/src/widgets/Jitsi.ts +++ b/apps/web/src/widgets/Jitsi.ts @@ -63,7 +63,7 @@ export class Jitsi { const cli = MatrixClientPeg.safeGet(); cli.on(ClientEvent.ClientWellKnown, this.update); // call update initially in case we missed the first WellKnown.client event and for if no well-known present - this.update(cli.getClientWellKnown()); + void this.update(cli.getClientWellKnown()); } private update = async (discoveryResponse?: IClientWellKnown): Promise => { diff --git a/oxlint.config.ts b/oxlint.config.ts index 93eb36835f..1b80a1cfb0 100644 --- a/oxlint.config.ts +++ b/oxlint.config.ts @@ -198,6 +198,15 @@ export default defineConfig({ allowExpressions: true, }, ], + // Require explicit handling of promises + "typescript/no-floating-promises": [ + "error", + { + checkThenables: true, + ignoreIIFE: true, + ignoreVoid: true, + }, + ], // Prevent invalid non-type re-exports of types, these can cause downstream build failures "typescript/consistent-type-exports": ["error"], @@ -236,7 +245,6 @@ export default defineConfig({ "typescript/no-redundant-type-constituents": "off", "typescript/no-useless-default-assignment": "off", "typescript/no-duplicate-type-constituents": "off", - "typescript/no-floating-promises": "off", "typescript/no-implied-eval": "off", "typescript/no-misused-spread": "off", "promise/valid-params": "off", diff --git a/packages/shared-components/src/core/i18n/i18n.tsx b/packages/shared-components/src/core/i18n/i18n.tsx index ea6e0cf419..f0397cce4d 100644 --- a/packages/shared-components/src/core/i18n/i18n.tsx +++ b/packages/shared-components/src/core/i18n/i18n.tsx @@ -361,11 +361,11 @@ export function replaceByRegexes(text: string, mapping: IVariables | Tags): stri // Insert in reverse order as splice does insert-before and this way we get the final order correct // remove the old element at the same time - output.splice(outputIndex, 1, ...parts); + void output.splice(outputIndex, 1, ...parts); if (head !== "") { // Don't push empty nodes, they are of no use - output.splice(outputIndex, 0, head); + void output.splice(outputIndex, 0, head); } } if (!matchFoundSomewhere) {