Hotfix for history post

This commit is contained in:
Sean Edmunds
2025-02-20 16:36:03 -06:00
parent f5f0dcf566
commit b017e02747

View File

@@ -61,7 +61,6 @@ export default function Search({
const handleKeyPress = (item: any) => { const handleKeyPress = (item: any) => {
let option = ''; let option = '';
let subtext = ''; let subtext = '';
if (item.target.value.startsWith('/')) { if (item.target.value.startsWith('/')) {
option = option =
item.target.value.substr(1, item.target.value.indexOf(' ') - 1) || item.target.value.substr(1, item.target.value.indexOf(' ') - 1) ||
@@ -82,8 +81,9 @@ export default function Search({
method: 'POST', method: 'POST',
endpoint: 'api/searchHistory', endpoint: 'api/searchHistory',
body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext }, body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext },
}).then(() => {
open(`${providerURL}${subtext}`, '_self');
}); });
open(`${providerURL}${subtext}`, '_self');
} else if (providerLabel === 'Show weather') { } else if (providerLabel === 'Show weather') {
openWeatherModal(); openWeatherModal();
} else if (providerLabel.startsWith('Launch')) { } else if (providerLabel.startsWith('Launch')) {
@@ -100,8 +100,9 @@ export default function Search({
method: 'POST', method: 'POST',
endpoint: 'api/searchHistory', endpoint: 'api/searchHistory',
body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext }, body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext },
}).then(() => {
open(`${providerURL}${subtext}`, '_self');
}); });
open(`${providerURL}${subtext}`, '_self');
} }
} }
}; };