mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-11 06:53:12 +08:00
Search bar redirect to local search results
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { urlParser } from '.';
|
||||
|
||||
export const redirectUrl = (url: string, sameTab: boolean) => {
|
||||
const parsedUrl = urlParser(url)[1];
|
||||
|
||||
if (sameTab) {
|
||||
document.location.replace(url);
|
||||
document.location.replace(parsedUrl);
|
||||
} else {
|
||||
window.open(url);
|
||||
window.open(parsedUrl);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user