We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4063fd3 commit 43f4235Copy full SHA for 43f4235
src/app/session-logout/page.tsx
@@ -1,16 +1,21 @@
1
"use client";
2
3
import MainContent from "@src/app/_components/nhs-frontend/MainContent";
4
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
5
6
const SessionLogout = () => {
7
+ const [isOpenInNHSApp, setIsOpenInNHSApp] = useState(true);
8
+
9
useEffect(() => {
10
if (window.nhsapp.tools.isOpenInNHSApp()) {
11
+ setIsOpenInNHSApp(true);
12
window.nhsapp.navigation.goToHomePage();
13
+ } else {
14
+ setIsOpenInNHSApp(false);
15
}
16
}, []);
17
- return (
18
+ return ( !isOpenInNHSApp &&
19
<MainContent>
20
<title>You have logged out</title>
21
<h1>You have logged out</h1>
0 commit comments