diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-04-07 16:50:53 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-05-28 13:25:25 +0200 |
| commit | 33af76ac6f6d913ed1a2093df091396f92debc2b (patch) | |
| tree | 612291425635b1c0b570db6a13e195e8db648a84 | |
| parent | 97e5a14f0286af3677668c48cc5bb72945f8c206 (diff) | |
| download | mullvadvpn-33af76ac6f6d913ed1a2093df091396f92debc2b.tar.xz mullvadvpn-33af76ac6f6d913ed1a2093df091396f92debc2b.zip | |
Rewrite usePushProblemReport to use history state over search params
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts b/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts index 04fc94dc2a..598fd2c944 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts +++ b/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts @@ -1,21 +1,24 @@ import { useCallback } from 'react'; import { useHistory } from 'react-router'; +import { LocationState } from '../../../shared/ipc-types'; import { RoutePath } from '../../lib/routes'; export type PushProblemReportProps = { - search?: string; + state?: Partial<LocationState>; }; -export const usePushProblemReport = ({ search }: PushProblemReportProps = {}) => { +export const usePushProblemReport = ({ state }: PushProblemReportProps = {}) => { const history = useHistory(); const pushProblemReport = useCallback(() => { - history.push({ - pathname: RoutePath.problemReport, - search, - }); - }, [history, search]); + history.push( + { + pathname: RoutePath.problemReport, + }, + state, + ); + }, [history, state]); return pushProblemReport; }; |
