diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-03-28 16:34:07 +0100 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-05-28 13:25:24 +0200 |
| commit | a467c93f7b16a1baca8920a4e3507157507e7e47 (patch) | |
| tree | 81a8c72dc1acd8b9f7d73a25453c818fe45b42ca | |
| parent | e41c042452b05c4e87fefd11d278cca8c7d2998c (diff) | |
| download | mullvadvpn-a467c93f7b16a1baca8920a4e3507157507e7e47.tar.xz mullvadvpn-a467c93f7b16a1baca8920a4e3507157507e7e47.zip | |
Add usePushProblemReport history hook
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/history/hooks/index.ts | 1 | ||||
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/history/hooks/index.ts b/desktop/packages/mullvad-vpn/src/renderer/history/hooks/index.ts index b9448e4c39..f22b1d9062 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/history/hooks/index.ts +++ b/desktop/packages/mullvad-vpn/src/renderer/history/hooks/index.ts @@ -1,3 +1,4 @@ export * from './usePop'; export * from './usePushAppUpgrade'; export * from './usePushChangelog'; +export * from './usePushProblemReport'; diff --git a/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts b/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts new file mode 100644 index 0000000000..04fc94dc2a --- /dev/null +++ b/desktop/packages/mullvad-vpn/src/renderer/history/hooks/usePushProblemReport.ts @@ -0,0 +1,21 @@ +import { useCallback } from 'react'; +import { useHistory } from 'react-router'; + +import { RoutePath } from '../../lib/routes'; + +export type PushProblemReportProps = { + search?: string; +}; + +export const usePushProblemReport = ({ search }: PushProblemReportProps = {}) => { + const history = useHistory(); + + const pushProblemReport = useCallback(() => { + history.push({ + pathname: RoutePath.problemReport, + search, + }); + }, [history, search]); + + return pushProblemReport; +}; |
