Skip to content

Commit

Permalink
fix: 🐛 No-query destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
okunamayanad committed Feb 20, 2025
1 parent cea48a6 commit e486418
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ function getBangredirectUrl() {
// Remove the first bang from the query
const cleanQuery = query.replace(/!\S+\s*/i, "").trim();

// If the query is empty, use "d" instead
if (cleanQuery === "") {
const searchUrl = "https://" + selectedBang?.d;
console.log(searchUrl);
if (!searchUrl) return null;
return searchUrl;
}

// Format of the url is:
// https://www.google.com/search?q={{{s}}}
const searchUrl = selectedBang?.u.replace(
Expand Down

0 comments on commit e486418

Please sign in to comment.