From a02efcadd4002f456c097a2e9d6488b204a6e0b2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 7 Jun 2022 16:56:45 -0500 Subject: [PATCH] Preserve password reset URL query --- app/soapbox/features/auth_layout/index.tsx | 5 +++-- app/soapbox/features/ui/index.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/soapbox/features/auth_layout/index.tsx b/app/soapbox/features/auth_layout/index.tsx index ca72f4107..152236381 100644 --- a/app/soapbox/features/auth_layout/index.tsx +++ b/app/soapbox/features/auth_layout/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { Link, Redirect, Route, Switch, useHistory } from 'react-router-dom'; +import { Link, Redirect, Route, Switch, useHistory, useLocation } from 'react-router-dom'; import LandingGradient from 'soapbox/components/landing-gradient'; import SiteLogo from 'soapbox/components/site-logo'; @@ -23,6 +23,7 @@ const messages = defineMessages({ const AuthLayout = () => { const intl = useIntl(); const history = useHistory(); + const { search } = useLocation(); const siteTitle = useAppSelector(state => state.instance.title); const soapboxConfig = useSoapboxConfig(); @@ -76,7 +77,7 @@ const AuthLayout = () => { - + diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 9520320e2..c1057950c 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -5,7 +5,7 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; import { HotKeys } from 'react-hotkeys'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; -import { Switch, useHistory, matchPath, Redirect } from 'react-router-dom'; +import { Switch, useHistory, useLocation, matchPath, Redirect } from 'react-router-dom'; import { fetchFollowRequests } from 'soapbox/actions/accounts'; import { fetchReports, fetchUsers, fetchConfig } from 'soapbox/actions/admin'; @@ -156,8 +156,8 @@ const keyMap = { }; const SwitchingColumnsArea: React.FC = ({ children }) => { - const history = useHistory(); const features = useFeatures(); + const { search } = useLocation(); const { authenticatedProfile, cryptoAddresses } = useSoapboxConfig(); const hasCrypto = cryptoAddresses.size > 0; @@ -232,7 +232,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { - + @@ -247,7 +247,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { - +