From cb43cc2dfeab49e8508dd6704bd11257d309bf0b Mon Sep 17 00:00:00 2001 From: Pavel Meyer Date: Sun, 21 Apr 2024 22:19:00 +0300 Subject: [PATCH] CW-Webview-back-button Fix --- src/pages/empty/EmptyPage.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/pages/empty/EmptyPage.tsx b/src/pages/empty/EmptyPage.tsx index 632864af8c..c4eec74e79 100644 --- a/src/pages/empty/EmptyPage.tsx +++ b/src/pages/empty/EmptyPage.tsx @@ -1,5 +1,19 @@ -import React, { FC } from "react"; +import React, { FC, useEffect } from "react"; +import { useSelector } from "react-redux"; +import { history } from "@/shared/appConfig"; +import { getInboxPagePath } from "@/shared/utils"; +import { selectUser } from "../Auth/store/selectors"; -const EmptyPage: FC = () => null; +const EmptyPage: FC = () => { + const user = useSelector(selectUser()); + + useEffect(() => { + if (user) { + history.push(getInboxPagePath()); + } + }, [user]); + + return null; +}; export default EmptyPage;