Skip to content

Commit

Permalink
add switching on paste mode if location hash contains paste
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-sz committed Oct 30, 2023
1 parent abd8c32 commit 849bfa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web/src/screens/Redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 1 addition & 1 deletion web/src/sections/Network/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 849bfa6

Please sign in to comment.