Skip to content

Commit 822b67e

Browse files
committed
fix: entire function type inference
1 parent 69e22b1 commit 822b67e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/command-palette.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ export default function CommandPalette({ open, setOpen }) {
4444
setSearchTerm('');
4545
};
4646

47-
const onItemSelected = (url: Location | (Location & string)) => {
47+
const onItemSelected = (url: string | Location) => {
4848
if (url) {
49-
(window as Window).location = url;
49+
window.location.href = typeof url === 'string' ? url : url.href;
5050
}
51-
}
51+
};
5252

5353
return (
5454
<Dialog

0 commit comments

Comments
 (0)