fix: be able to search summoners with 2 letters and a space

This commit is contained in:
Valentin Kaelin 2021-05-22 16:56:35 +02:00
parent a2fdea3f17
commit 8d3c777c1b
2 changed files with 2 additions and 2 deletions

View file

@ -148,7 +148,7 @@ export default {
document.body.style.overflow = 'hidden' document.body.style.overflow = 'hidden'
}, },
formSubmit() { formSubmit() {
const search = this.summoner.split(' ').join('') const search = this.summoner.split(' ').join('').replace('+', ' ')
if (search.length) { if (search.length) {
this.$emit('formSubmit', search, this.selectedRegion) this.$emit('formSubmit', search, this.selectedRegion)
} }

View file

@ -46,7 +46,7 @@ class SummonerService {
* @param region * @param region
*/ */
public async getAccount (summonerName: string, region: string) { public async getAccount (summonerName: string, region: string) {
const name = summonerName.toLowerCase().replace(/ /g, '') const name = summonerName.toLowerCase()
const account = await Jax.Summoner.summonerName(name, region) const account = await Jax.Summoner.summonerName(name, region)
return account return account
} }