Skip to content

Commit 43f4235

Browse files
VIA-172 AJ/AS Avoid a temporary render of the desktop version inside the mobile view
1 parent 4063fd3 commit 43f4235

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/app/session-logout/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
"use client";
22

33
import MainContent from "@src/app/_components/nhs-frontend/MainContent";
4-
import { useEffect } from "react";
4+
import { useEffect, useState } from "react";
55

66
const SessionLogout = () => {
7+
const [isOpenInNHSApp, setIsOpenInNHSApp] = useState(true);
8+
79
useEffect(() => {
810
if (window.nhsapp.tools.isOpenInNHSApp()) {
11+
setIsOpenInNHSApp(true);
912
window.nhsapp.navigation.goToHomePage();
13+
} else {
14+
setIsOpenInNHSApp(false);
1015
}
1116
}, []);
1217

13-
return (
18+
return ( !isOpenInNHSApp &&
1419
<MainContent>
1520
<title>You have logged out</title>
1621
<h1>You have logged out</h1>

0 commit comments

Comments
 (0)