From 849bfa6203586a0b6bf39b72613af669f43268df Mon Sep 17 00:00:00 2001 From: Mat Sz Date: Mon, 30 Oct 2023 18:21:21 +0100 Subject: [PATCH] add switching on paste mode if location hash contains paste --- web/src/screens/Redirect.tsx | 4 +++- web/src/sections/Network/index.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/screens/Redirect.tsx b/web/src/screens/Redirect.tsx index e13ed36..849fd9e 100644 --- a/web/src/screens/Redirect.tsx +++ b/web/src/screens/Redirect.tsx @@ -23,7 +23,9 @@ export const Redirect: React.FC = observer(() => { randomString(nameLength, nameCharacterSet); if (connected && clientId) { - navigate('/' + currentNetworkName, { replace: true }); + navigate('/' + currentNetworkName + window.location.hash, { + replace: true, + }); } }, [connected, networkName, navigate, clientId, suggestedNetworkName]); diff --git a/web/src/sections/Network/index.tsx b/web/src/sections/Network/index.tsx index 0099867..a3f51bb 100644 --- a/web/src/sections/Network/index.tsx +++ b/web/src/sections/Network/index.tsx @@ -16,7 +16,7 @@ export const NetworkSection: React.FC = observer(() => { const clients = networkStore.clients; const transfers = networkStore.transfers; const { t } = useTranslation(); - const [isPaste, setPaste] = useState(false); + const [isPaste, setPaste] = useState(window.location.hash === '#paste'); const showPaste = applicationStore.showPaste; const sendFromClipboard = isPaste && showPaste;