diff --git a/nym-wallet/src/index.tsx b/nym-wallet/src/index.tsx index e82e698c45..0ac5588621 100644 --- a/nym-wallet/src/index.tsx +++ b/nym-wallet/src/index.tsx @@ -1,4 +1,4 @@ -import React, { useContext } from 'react' +import React, { useContext, useEffect, useLayoutEffect } from 'react' import ReactDOM from 'react-dom' import { ErrorBoundary } from 'react-error-boundary' import { BrowserRouter as Router } from 'react-router-dom' @@ -10,9 +10,15 @@ import { Admin, Welcome } from './pages' import { ErrorFallback } from './components' import { NymWalletTheme, WelcomeTheme } from './theme' import { Settings } from './pages' +import { maximizeWindow } from './utils' const App = () => { const { clientDetails } = useContext(ClientContext) + + useLayoutEffect(() => { + maximizeWindow() + }, []) + return !clientDetails ? ( diff --git a/nym-wallet/src/utils/index.ts b/nym-wallet/src/utils/index.ts index 1bb1ec46dc..84db65a968 100644 --- a/nym-wallet/src/utils/index.ts +++ b/nym-wallet/src/utils/index.ts @@ -1,4 +1,5 @@ import { invoke } from '@tauri-apps/api' +import { appWindow } from '@tauri-apps/api/window' import bs58 from 'bs58' import { minor, valid } from 'semver' import { userBalance, majorToMinor, getGasFee } from '../requests' @@ -132,3 +133,7 @@ export const splice = (start: number, deleteCount: number, address?: string) => return array.join('') } } + +export const maximizeWindow = async () => { + await appWindow.maximize() +}