home, subscription and other fixes
This commit is contained in:
@@ -55,6 +55,7 @@ const HIDDEN_ROUTE_NAMES = new Set([
|
||||
Routes.Notifications,
|
||||
Routes.Language,
|
||||
Routes.Login,
|
||||
Routes.ResetPassword,
|
||||
Routes.Register,
|
||||
]);
|
||||
|
||||
|
||||
@@ -191,6 +191,12 @@ const UniversalLinkProvider = ({ children }) => {
|
||||
useEffect(() => {
|
||||
if (!pendingNavigation || !isFullyLoaded) return;
|
||||
|
||||
if (pendingNavigation.type === "resetPassword") {
|
||||
navigate(Routes.ResetPassword, pendingNavigation.params);
|
||||
setPendingNavigation(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pendingNavigation.type === "task") {
|
||||
if (!currentUID) return;
|
||||
navigateToTask(pendingNavigation.params);
|
||||
@@ -211,6 +217,36 @@ const UniversalLinkProvider = ({ children }) => {
|
||||
}, [pendingNavigation, currentUID, isFullyLoaded]);
|
||||
const handleParams = (path, queryParams = {}) => {
|
||||
const normalizedPath = normalizePath(path);
|
||||
|
||||
const modeParam = queryParams?.mode;
|
||||
const resetMode =
|
||||
typeof modeParam === "string" && modeParam.toLowerCase() === "resetpassword";
|
||||
const oobCodeParam = queryParams?.oobCode;
|
||||
|
||||
if (resetMode && typeof oobCodeParam === "string" && oobCodeParam.trim()) {
|
||||
setPendingNavigation({
|
||||
type: "resetPassword",
|
||||
params: {
|
||||
oobCode: oobCodeParam.trim(),
|
||||
continueUrl:
|
||||
typeof queryParams?.continueUrl === "string"
|
||||
? queryParams.continueUrl
|
||||
: typeof queryParams?.continueURL === "string"
|
||||
? queryParams.continueURL
|
||||
: null,
|
||||
lang:
|
||||
typeof queryParams?.lang === "string"
|
||||
? queryParams.lang
|
||||
: typeof queryParams?.language === "string"
|
||||
? queryParams.language
|
||||
: null,
|
||||
email:
|
||||
typeof queryParams?.email === "string" ? queryParams.email : null,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!normalizedPath) return;
|
||||
|
||||
if (normalizedPath.toLowerCase() === "link") {
|
||||
|
||||
Reference in New Issue
Block a user