Migrate to stylistic

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-16 16:43:07 +01:00
parent d8052e6a73
commit 6c6bf811a6
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
124 changed files with 239 additions and 196 deletions

View file

@ -9,6 +9,7 @@ Please see LICENSE files in the repository root for full details.
import React, { useEffect, useState } from "react";
import { _t } from "../../languageHandler";
import UploadBigSvg from "../../../res/img/upload-big.svg";
interface IProps {
parent: HTMLElement | null;
@ -106,11 +107,7 @@ const FileDropTarget: React.FC<IProps> = ({ parent, onFileDrop }) => {
if (state.dragging) {
return (
<div className="mx_FileDropTarget">
<img
src={require("../../../res/img/upload-big.svg").default}
className="mx_FileDropTarget_image"
alt=""
/>
<img src={UploadBigSvg} className="mx_FileDropTarget_image" alt="" />
{_t("room|drop_file_prompt")}
</div>
);

View file

@ -161,9 +161,11 @@ export default class LegacyCallEventGrouper extends EventEmitter {
public toggleSilenced = (): void => {
const silenced = LegacyCallHandler.instance.isCallSilenced(this.callId);
silenced
? LegacyCallHandler.instance.unSilenceCall(this.callId)
: LegacyCallHandler.instance.silenceCall(this.callId);
if (silenced) {
LegacyCallHandler.instance.unSilenceCall(this.callId);
} else {
LegacyCallHandler.instance.silenceCall(this.callId);
}
};
private setCallListeners(): void {

View file

@ -982,7 +982,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
try {
const config = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(params.hs_url);
newState.serverConfig = config;
} catch (err) {
} catch {
logger.warn("Failed to load hs_url param:", params.hs_url);
}
} else if (params.client_secret && params.session_id && params.hs_url && params.is_url && params.sid) {

View file

@ -691,7 +691,7 @@ const ManageButtons: React.FC<IManageButtonsProps> = ({ hierarchy, selected, set
hierarchy.removeRelation(parentId, childId);
}
} catch (e) {
} catch {
setError(_t("space|failed_remove_rooms"));
}
setRemoving(false);
@ -724,7 +724,7 @@ const ManageButtons: React.FC<IManageButtonsProps> = ({ hierarchy, selected, set
// mutate the local state to save us having to refetch the world
existingContent.suggested = content.suggested;
}
} catch (e) {
} catch {
setError("Failed to update some suggestions. Try again later");
}
setSaving(false);

View file

@ -973,7 +973,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
UserActivity.sharedInstance().timeWhileActiveRecently(this.readMarkerActivityTimer);
try {
await this.readMarkerActivityTimer.finished();
} catch (e) {
} catch {
continue; /* aborted */
}
// outside of try/catch to not swallow errors
@ -988,7 +988,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
UserActivity.sharedInstance().timeWhileActiveNow(this.readReceiptActivityTimer);
try {
await this.readReceiptActivityTimer.finished();
} catch (e) {
} catch {
continue; /* aborted */
}
// outside of try/catch to not swallow errors

View file

@ -44,6 +44,7 @@ import { Icon as LiveIcon } from "../../../res/img/compound/live-8px.svg";
import { VoiceBroadcastRecording, VoiceBroadcastRecordingsStoreEvent } from "../../voice-broadcast";
import { SDKContext } from "../../contexts/SDKContext";
import { shouldShowFeedback } from "../../utils/Feedback";
import DarkLightModeSvg from "../../../res/img/element-icons/roomlist/dark-light-mode.svg";
interface IProps {
isPanelCollapsed: boolean;
@ -414,12 +415,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
: _t("user_menu|switch_theme_dark")
}
>
<img
src={require("../../../res/img/element-icons/roomlist/dark-light-mode.svg").default}
role="presentation"
alt=""
width={16}
/>
<img src={DarkLightModeSvg} role="presentation" alt="" width={16} />
</RovingAccessibleButton>
</div>
{topSection}

View file

@ -274,7 +274,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
await this.reset.setNewPassword(this.state.password);
this.setState({ phase: Phase.Done });
modal.close();
} catch (e) {
} catch {
// Email not confirmed, yet. Retry after a while.
await sleep(emailCheckInterval);
}

View file

@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
*/
// We're importing via require specifically so the svg becomes a URI rather than a DOM element.
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const matrixSvg = require("../../../res/img/matrix.svg").default;
/**