More clippy and linting

This commit is contained in:
Tommy Verrall
2026-04-17 12:36:20 +02:00
parent 52cc77356e
commit a0fb92cf17
7 changed files with 27 additions and 18 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ fn main() {
app::react::set_react_state,
app::react::get_react_state,
])
.menu(|app| menu::build_app_menu(app))
.menu(menu::build_app_menu)
.on_menu_event(|app, event| {
if event.id() == SHOW_LOG_WINDOW {
let _r = help::log::help_log_toggle_window(app.app_handle().clone());
+2 -2
View File
@@ -386,8 +386,8 @@ impl WalletStateInner {
// All urls for all networks
let nyxd_urls = self
.get_all_nyxd_urls()
.into_iter()
.flat_map(|(_, urls)| urls.into_iter());
.into_values()
.flat_map(|urls| urls.into_iter());
// Fetch status for all urls
let responses = fetch_status_for_urls(nyxd_urls).await?;
+2 -2
View File
@@ -1,8 +1,6 @@
import React, { ComponentType, useEffect } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { BrowserRouter, HashRouter } from 'react-router-dom';
type RouterComponent = ComponentType<{ children?: React.ReactNode }>;
import { SnackbarProvider } from 'notistack';
import { AppProvider } from './context/main';
import { ErrorFallback } from './components';
@@ -11,6 +9,8 @@ import { maximizeWindow } from './utils';
import { config } from './config';
import { useTauriTextEditingClipboard } from './hooks/useTauriTextEditingClipboard';
type RouterComponent = ComponentType<{ children?: React.ReactNode }>;
const ClipboardBridge: FCWithChildren = ({ children }) => {
useTauriTextEditingClipboard();
return children;
@@ -158,12 +158,12 @@ export const AddAccountModal = () => {
setData((d) => ({ ...d, mnemonic: mnemon }));
} catch (e) {
setData((d) => ({ ...d, mnemonic: '' }));
const message =
typeof e === 'string'
? e
: e instanceof Error
? e.message
: 'Could not generate a recovery phrase. Try again.';
let message = 'Could not generate a recovery phrase. Try again.';
if (typeof e === 'string') {
message = e;
} else if (e instanceof Error) {
message = e.message;
}
setError(message);
}
};
@@ -10,12 +10,19 @@ export const LoadingModal: FCWithChildren<{
const theme = useTheme();
const { sx: backdropSx, ...backdropRest } = backdropProps || {};
let extraBackdropSx: SxProps[] = [];
if (Array.isArray(backdropSx)) {
extraBackdropSx = backdropSx as SxProps[];
} else if (backdropSx) {
extraBackdropSx = [backdropSx];
}
const backdropSxArray = [
{
backdropFilter: 'blur(12px)',
backgroundColor: alpha(theme.palette.common.black, theme.palette.mode === 'dark' ? 0.5 : 0.34),
},
...(Array.isArray(backdropSx) ? backdropSx : backdropSx ? [backdropSx] : []),
...extraBackdropSx,
];
return (
+6 -6
View File
@@ -34,12 +34,12 @@ export const AuthProvider: FCWithChildren = ({ children }) => {
setMnemonic(mnemonicPhrase);
} catch (e) {
setMnemonic('');
const message =
typeof e === 'string'
? e
: e instanceof Error
? e.message
: 'Could not generate a recovery phrase. Try again.';
let message = 'Could not generate a recovery phrase. Try again.';
if (typeof e === 'string') {
message = e;
} else if (e instanceof Error) {
message = e.message;
}
setError(message);
}
};
+2
View File
@@ -81,6 +81,8 @@ export const Admin: FCWithChildren = () => {
setParams(undefined);
const msg = typeof e === 'string' ? e : String(e);
if (!msg.includes('temporarily disabled')) {
// Admin diagnostics only; contract fetch failures are otherwise silent in UI.
// eslint-disable-next-line no-console -- intentional dev/admin visibility
console.error('get_contract_settings failed', e);
}
} finally {