diff --git a/nym-wallet/src-tauri/src/main.rs b/nym-wallet/src-tauri/src/main.rs index 3aeb4e63f0..603469c1b2 100644 --- a/nym-wallet/src-tauri/src/main.rs +++ b/nym-wallet/src-tauri/src/main.rs @@ -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()); diff --git a/nym-wallet/src-tauri/src/state.rs b/nym-wallet/src-tauri/src/state.rs index 714f542498..869a13ceb1 100644 --- a/nym-wallet/src-tauri/src/state.rs +++ b/nym-wallet/src-tauri/src/state.rs @@ -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?; diff --git a/nym-wallet/src/common.tsx b/nym-wallet/src/common.tsx index 29251fa292..03b90c8d62 100644 --- a/nym-wallet/src/common.tsx +++ b/nym-wallet/src/common.tsx @@ -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; diff --git a/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx index 8b91f98aed..bf9a5c0c9b 100644 --- a/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx @@ -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); } }; diff --git a/nym-wallet/src/components/Modals/LoadingModal.tsx b/nym-wallet/src/components/Modals/LoadingModal.tsx index f7fc580ff6..1d25a6bcc5 100644 --- a/nym-wallet/src/components/Modals/LoadingModal.tsx +++ b/nym-wallet/src/components/Modals/LoadingModal.tsx @@ -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 ( diff --git a/nym-wallet/src/context/auth.tsx b/nym-wallet/src/context/auth.tsx index b6a80140b2..597aa93ec2 100644 --- a/nym-wallet/src/context/auth.tsx +++ b/nym-wallet/src/context/auth.tsx @@ -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); } }; diff --git a/nym-wallet/src/pages/Admin/index.tsx b/nym-wallet/src/pages/Admin/index.tsx index 0fb68f307a..a1ca3e2bad 100644 --- a/nym-wallet/src/pages/Admin/index.tsx +++ b/nym-wallet/src/pages/Admin/index.tsx @@ -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 {