Commit e37288c1eddd72e5d911ccbc966d5b58020827c8
Fix prefix logic for link handler
Double negatives have fooled me again! - Before: "if there aren't any prefixes which aren't the link prefix" - After: "if every prefix is not the link prefix"Christian Bundy committed on 1/17/2019, 11:35:28 PM
Parent: de24e594e99f9352ee3679a960c1a20af79c6882
Files changed
app/html/search-bar.js | changed |
app/html/search-bar.js | ||
---|---|---|
@@ -21,9 +21,9 @@ | ||
21 | 21 … | const prefixes = ['@', '#', '%', '&', '/', 'ssb:'] |
22 | 22 … | |
23 | 23 … | if (location[0] === '?') { |
24 | 24 … | location = { page: 'search', query: location.substring(1) } |
25 | - } else if (prefixes.some(p => !location.startsWith(p)) === false) { | |
25 … | + } else if (prefixes.every(p => !location.startsWith(p))) { | |
26 | 26 … | location = { page: 'search', query: location } |
27 | 27 … | } |
28 | 28 … | |
29 | 29 … | api.app.sync.goTo(location) |
Built with git-ssb-web