🐛 Fixed /unsplash search term not including all words

no issue

- card definitions allow multiple params split by spaces in /menu commands but that meant for search terms that included spaces only the first word was being captured
- updated the param handling so the last param specified includes all remaining words in the slash command
This commit is contained in:
Kevin Ansfield 2021-11-24 22:41:18 +00:00
parent 0f517ad4e6
commit 7ff73753c8

View File

@ -201,9 +201,16 @@ export default class KoenigSlashMenuComponent extends Component {
let payload = Object.assign({}, item.payload);
// params are order-dependent and listed in CARD_MENU for each card
// last param will include all remaining text including spaces
if (!isEmpty(item.params) && !isEmpty(params)) {
item.params.forEach((param, i) => {
payload[param] = params[i];
let value = params[i];
if (i === item.params.length - 1) {
value = params.slice(i).join(' ');
}
payload[param] = value;
});
}