Skip to content

Commit

Permalink
Merge pull request #1337 from mohamed1408/Updating_URL_Issue#1273
Browse files Browse the repository at this point in the history
fixes #1273 - Updating or Removing URL Query Params not updating the …
  • Loading branch information
violetadev authored Dec 14, 2024
2 parents f7c0976 + 42dd557 commit 3cf60a0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions desktop-app/src/renderer/components/ToolBar/AddressBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const AddressBar = () => {
}
newAddress = protocol + typedAddress;
}

if (url && url !== typedAddress) setTypedAddress(url);
dispatch(setAddress(newAddress));
},
[dispatch, typedAddress]
Expand Down Expand Up @@ -131,9 +131,15 @@ const AddressBar = () => {
setPermissionRequest(null);
};

const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = () => {
if (!isSuggesting) {
const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = (
e: React.KeyboardEvent<HTMLInputElement>
) => {
if (!isSuggesting && !['Escape', 'Enter'].includes(e.key)) {
setIsSuggesting(true);
} else if (e.key === 'Escape' && isSuggesting) {
setIsSuggesting(false);
} else if (e.key === 'Enter' && !isSuggesting) {
dispatchAddress(typedAddress);
}
};

Expand Down

0 comments on commit 3cf60a0

Please sign in to comment.