Fix quick launch not opening with accented characters, decoding of characters in suggestions (#2802)

pull/2804/head
shamoon 4 months ago committed by GitHub
parent 578def33f5
commit 1ddd528bd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -224,7 +224,10 @@ function Home({ initialSettings }) {
function handleKeyDown(e) {
if (e.target.tagName === "BODY" || e.target.id === "inner_wrapper") {
if (
(e.key.length === 1 && e.key.match(/(\w|\s)/g) && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) ||
(e.key.length === 1 &&
e.key.match(/(\w|\s|[à-ü]|[À-Ü])/g) &&
!(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) ||
e.key.match(/([à-ü]|[À-Ü])/g) || // accented characters may require modifier keys
(e.key === "v" && (e.ctrlKey || e.metaKey))
) {
setSearching(true);

@ -12,7 +12,8 @@ export default async function cachedFetch(url, duration) {
return cached;
}
const data = await fetch(url).then((res) => res.json());
// wrapping text in JSON.parse to handle utf-8 issues
const data = JSON.parse(await fetch(url).then((res) => res.text()));
cache.put(url, data, duration * 1000 * 60);
return data;
}

Loading…
Cancel
Save