fix tickets add reort mail and design fixes
This commit is contained in:
@@ -54,6 +54,8 @@ const HIDDEN_ROUTE_NAMES = new Set([
|
||||
Routes.ChangePassword,
|
||||
Routes.Notifications,
|
||||
Routes.Language,
|
||||
Routes.Login,
|
||||
Routes.Register,
|
||||
]);
|
||||
|
||||
const noopAsync = async () => {};
|
||||
|
||||
@@ -2,7 +2,8 @@ import { useContext, useState, useEffect } from "reactn";
|
||||
import * as Linking from "expo-linking";
|
||||
import { UserDataContext } from "./UserDataProvider";
|
||||
import { isWeb } from "../hooks/useLayoutType";
|
||||
import { navigateToTask } from "../navigation/NavigationService";
|
||||
import { navigate, navigateToTask } from "../navigation/NavigationService";
|
||||
import { Routes } from "../navigation/Routes";
|
||||
import { SplashAnimationContext } from "./SplashAnimationProvider";
|
||||
const appJson = require("../../app.json");
|
||||
|
||||
@@ -16,6 +17,7 @@ const UniversalLinkProvider = ({ children }) => {
|
||||
const { isFullyLoaded } = useContext(SplashAnimationContext);
|
||||
|
||||
const [tempTaskData, setTempTaskData] = useState(null);
|
||||
const [pendingMusicId, setPendingMusicId] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleDeepLink = async (event) => {
|
||||
@@ -51,13 +53,13 @@ const UniversalLinkProvider = ({ children }) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Redirection error:", error);
|
||||
handleParams(path);
|
||||
handleParams(path, queryParams);
|
||||
}
|
||||
} else {
|
||||
handleParams(path);
|
||||
handleParams(path, queryParams);
|
||||
}
|
||||
} else {
|
||||
handleParams(path);
|
||||
handleParams(path, queryParams);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -86,8 +88,31 @@ const UniversalLinkProvider = ({ children }) => {
|
||||
}
|
||||
}, [tempTaskData, currentUID, isFullyLoaded]);
|
||||
|
||||
const handleParams = (path) => {
|
||||
// console.log("path", path);
|
||||
useEffect(() => {
|
||||
if (!pendingMusicId || !isFullyLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
navigate(Routes.MusicDetails, {
|
||||
projectId: pendingMusicId,
|
||||
autoPlay: true,
|
||||
action: "share",
|
||||
});
|
||||
setPendingMusicId(null);
|
||||
}, [isFullyLoaded, pendingMusicId]);
|
||||
|
||||
const handleParams = (path, _queryParams = {}) => {
|
||||
if (typeof path === "string" && path.length > 0) {
|
||||
const normalized = path.replace(/^\/+/, "");
|
||||
const [first, second] = normalized.split("/");
|
||||
if (first?.toLowerCase() === "music" && second) {
|
||||
try {
|
||||
setPendingMusicId(decodeURIComponent(second));
|
||||
} catch (_) {
|
||||
setPendingMusicId(second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cleanURL();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user