Hotfix for history post
This commit is contained in:
@@ -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');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user