mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-26 04:57:08 -05:00
Account for search queries when returning to page
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useLocation } from "react-router";
|
||||
import { useLocation } from "remix";
|
||||
import { getLogInUrl } from "~/utils";
|
||||
import { useUser } from "~/utils/hooks";
|
||||
import { DiscordIcon } from "../icons/Discord";
|
||||
|
||||
@@ -26,7 +26,9 @@ export function getUser(ctx: any) {
|
||||
|
||||
/** Get link to log in with query param set as current page */
|
||||
export function getLogInUrl(location: ReturnType<typeof useLocation>) {
|
||||
return `/auth/discord?origin=${encodeURIComponent(location.pathname)}`;
|
||||
return `/auth/discord?origin=${encodeURIComponent(
|
||||
location.pathname + location.search
|
||||
)}`;
|
||||
}
|
||||
|
||||
/** Get fields from `request.formData()`. Throw an error if the formData doesn't contain a requested field. */
|
||||
|
||||
Reference in New Issue
Block a user