diff options
| author | Oskar <oskar@mullvad.net> | 2024-09-20 16:29:26 +0200 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-09-24 13:18:18 +0200 |
| commit | 4bb25616f02af4e15b0140767c07b61e49e8aa83 (patch) | |
| tree | ed5371911d23ba2bab8e701f351d822202d63d57 /gui/src/renderer/components | |
| parent | 659aa11f05ae2b278eef6ab0ef5bc537e756109a (diff) | |
| download | mullvadvpn-4bb25616f02af4e15b0140767c07b61e49e8aa83.tar.xz mullvadvpn-4bb25616f02af4e15b0140767c07b61e49e8aa83.zip | |
Fix linting errors
Diffstat (limited to 'gui/src/renderer/components')
| -rw-r--r-- | gui/src/renderer/components/ClipboardLabel.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/EditApiAccessMethod.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/ImageView.tsx | 1 | ||||
| -rw-r--r-- | gui/src/renderer/components/Login.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/NotificationBanner.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/ProblemReport.tsx | 6 | ||||
| -rw-r--r-- | gui/src/renderer/components/main-view/FeatureIndicators.tsx | 2 |
7 files changed, 8 insertions, 9 deletions
diff --git a/gui/src/renderer/components/ClipboardLabel.tsx b/gui/src/renderer/components/ClipboardLabel.tsx index 582e03b02d..e9f760fd07 100644 --- a/gui/src/renderer/components/ClipboardLabel.tsx +++ b/gui/src/renderer/components/ClipboardLabel.tsx @@ -62,7 +62,7 @@ export default function ClipboardLabel(props: IProps) { return ( <StyledLabelContainer> <StyledLabel aria-hidden={obscured} {...otherProps}> - {obscured ? '●●●● ●●●● ●●●● ●●●●' : displayValue ?? value} + {obscured ? '●●●● ●●●● ●●●● ●●●●' : (displayValue ?? value)} </StyledLabel> {obscureValue !== false && ( <StyledButton diff --git a/gui/src/renderer/components/EditApiAccessMethod.tsx b/gui/src/renderer/components/EditApiAccessMethod.tsx index 97996d7f42..a8602675a0 100644 --- a/gui/src/renderer/components/EditApiAccessMethod.tsx +++ b/gui/src/renderer/components/EditApiAccessMethod.tsx @@ -62,7 +62,7 @@ function AccessMethodForm() { const onSave = useCallback( async (newMethod: NamedCustomProxy) => { - const enabled = id === undefined ? true : method?.enabled ?? true; + const enabled = id === undefined ? true : (method?.enabled ?? true); updatedMethod.current = { ...newMethod, enabled }; if ( updatedMethod.current !== undefined && diff --git a/gui/src/renderer/components/ImageView.tsx b/gui/src/renderer/components/ImageView.tsx index fa3855b21a..f40a93fbbc 100644 --- a/gui/src/renderer/components/ImageView.tsx +++ b/gui/src/renderer/components/ImageView.tsx @@ -46,7 +46,6 @@ export default function ImageView(props: IImageViewProps) { ? props.source : `../../assets/images/${props.source}.svg`; - // eslint-disable-next-line @typescript-eslint/naming-convention const style = useMemo(() => ({ WebkitMaskImage: `url('${url}')` }), [url]); if (props.tintColor) { diff --git a/gui/src/renderer/components/Login.tsx b/gui/src/renderer/components/Login.tsx index 32eb5bbe82..e5f981eafb 100644 --- a/gui/src/renderer/components/Login.tsx +++ b/gui/src/renderer/components/Login.tsx @@ -281,7 +281,7 @@ export default class Login extends React.Component<IProps, IState> { await this.props.clearAccountHistory(); // TODO: Remove account from memory - } catch (error) { + } catch { // TODO: Show error } } diff --git a/gui/src/renderer/components/NotificationBanner.tsx b/gui/src/renderer/components/NotificationBanner.tsx index ad84ad3697..f79855f004 100644 --- a/gui/src/renderer/components/NotificationBanner.tsx +++ b/gui/src/renderer/components/NotificationBanner.tsx @@ -167,7 +167,7 @@ export function NotificationBanner(props: INotificationBannerProps) { useEffect(() => { const newHeight = - props.children !== undefined ? contentRef.current?.getBoundingClientRect().height ?? 0 : 0; + props.children !== undefined ? (contentRef.current?.getBoundingClientRect().height ?? 0) : 0; if (newHeight !== contentHeight) { setContentHeight(newHeight); setAlignBottom((alignBottom) => alignBottom || contentHeight === 0 || newHeight === 0); diff --git a/gui/src/renderer/components/ProblemReport.tsx b/gui/src/renderer/components/ProblemReport.tsx index 3a0a9bbd0e..fd481cde07 100644 --- a/gui/src/renderer/components/ProblemReport.tsx +++ b/gui/src/renderer/components/ProblemReport.tsx @@ -137,7 +137,7 @@ function Form() { try { const reportId = await collectLog(); await viewLog(reportId); - } catch (error) { + } catch { // TODO: handle error } finally { setDisableActions(false); @@ -431,7 +431,7 @@ const ProblemReportContextProvider = ({ children }: { children: ReactNode }) => await sendProblemReport(email, message, reportId); clearReportForm(); setSendState(SendState.success); - } catch (error) { + } catch { setSendState(SendState.failed); } }, [email, message]); @@ -447,7 +447,7 @@ const ProblemReportContextProvider = ({ children }: { children: ReactNode }) => try { setSendState(SendState.sending); await sendReport(); - } catch (error) { + } catch { // No-op } } diff --git a/gui/src/renderer/components/main-view/FeatureIndicators.tsx b/gui/src/renderer/components/main-view/FeatureIndicators.tsx index 1696a6fd20..a4bf8659c6 100644 --- a/gui/src/renderer/components/main-view/FeatureIndicators.tsx +++ b/gui/src/renderer/components/main-view/FeatureIndicators.tsx @@ -116,7 +116,7 @@ export default function FeatureIndicators(props: FeatureIndicatorsProps) { tunnelState.state === 'connected' || tunnelState.state === 'connecting'; const featureIndicators = useRef( - featureIndicatorsVisible ? tunnelState.featureIndicators ?? [] : [], + featureIndicatorsVisible ? (tunnelState.featureIndicators ?? []) : [], ); if (featureIndicatorsVisible && tunnelState.featureIndicators) { |
