From fc6c10718a633f0439b3aac045d4537c58bc7c6e Mon Sep 17 00:00:00 2001
From: realtradam <github@tradam.dev>
Date: Wed, 19 Jun 2024 19:41:29 -0400
Subject: add small changes

---
 src/components/CloseWindow.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/components/CloseWindow.tsx')

diff --git a/src/components/CloseWindow.tsx b/src/components/CloseWindow.tsx
index 40c5962..bb33e0a 100644
--- a/src/components/CloseWindow.tsx
+++ b/src/components/CloseWindow.tsx
@@ -1,10 +1,17 @@
 //import { Link } from "react-router-dom";
 
 //export default () => (
-export default function Home () {
+export default function CloseWindow () {
 
+	// trigger localStorage listener in other tabs.
+	// this forces react rerender where required.
 	localStorage.setItem("logged in trigger", String(Math.random()));
+	// close window once done
 	window.close();
+
+	// window can only be closed if it was opened by javascript.
+	// if the window was opened by a user then just redirect to
+	// the home page instead.
 	window.location.replace("/");
 
 	return(
-- 
cgit v1.2.3

