Skip to content

Commit

Permalink
Merge pull request #65 from tonkeeper/hotfix/desktop-backup-dropdown
Browse files Browse the repository at this point in the history
Hotfix/desktop backup dropdown
  • Loading branch information
KuznetsovNikita authored Apr 4, 2024
2 parents 0a8bfd1 + 1343fd0 commit 2c1dfc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tonkeeper/desktop",
"license": "Apache-2.0",
"version": "3.9.2",
"version": "3.9.3",
"description": "Your desktop wallet on The Open Network",
"main": ".webpack/main",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Navigate, Outlet, Route, Routes } from 'react-router-dom';
import { Navigate, Outlet, Route, Routes, useLocation } from 'react-router-dom';
import { ProSettings } from '../../components/settings/ProSettings';
import { AppRoute, SettingsRoute, WalletSettingsRoute } from '../../libs/routes';
import { any, AppRoute, SettingsRoute, WalletSettingsRoute } from '../../libs/routes';
import { Localization } from '../../pages/settings/Localization';
import { Legal } from '../../pages/settings/Legal';
import { UserTheme } from '../../pages/settings/Theme';
Expand Down Expand Up @@ -39,12 +39,7 @@ export const DesktopPreferencesRouting = () => {
<Route path={SettingsRoute.fiat} element={<FiatCurrency />} />
<Route path={SettingsRoute.account} element={<Account />} />
<Route path={SettingsRoute.notification} element={<Notifications />} />
<Route
path={SettingsRoute.recovery}
element={
<Navigate to={AppRoute.walletSettings + WalletSettingsRoute.jettons} />
}
/>
<Route path={any(SettingsRoute.recovery)} element={<NavigateToRecovery />} />
<Route
path={SettingsRoute.version}
element={
Expand All @@ -60,7 +55,7 @@ export const DesktopPreferencesRouting = () => {
<Route
path={SettingsRoute.security}
element={
<Navigate to={AppRoute.walletSettings + WalletSettingsRoute.jettons} />
<Navigate to={AppRoute.walletSettings + WalletSettingsRoute.security} />
}
/>
<Route path={SettingsRoute.country} element={<CountrySettings />} />
Expand All @@ -70,3 +65,11 @@ export const DesktopPreferencesRouting = () => {
</Routes>
);
};

const NavigateToRecovery = () => {
const location = useLocation();

const newPath = location.pathname.replace(AppRoute.settings, AppRoute.walletSettings);

return <Navigate to={{ pathname: newPath, search: location.search }} replace={true} />;
};

0 comments on commit 2c1dfc9

Please sign in to comment.