From fa54e7f3f38466d06e55708fd473c972b2c9e3ce Mon Sep 17 00:00:00 2001 From: Manuel Kasper Date: Sun, 11 Jun 2023 19:55:56 +0200 Subject: [PATCH] Allow -??? summit numbers and XX/?? region codes as well --- src/components/EditAlert.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/EditAlert.vue b/src/components/EditAlert.vue index a21a3cd..cc8a2e8 100644 --- a/src/components/EditAlert.vue +++ b/src/components/EditAlert.vue @@ -152,11 +152,11 @@ export default { handler () { if (this.summitCode) { // Shorthand input - let summitRegex = /^([A-Z0-9]{1,8})[/ ]([A-Z]{2})[- ]?([0-9]{3}|xxx)$/i + let summitRegex = /^([A-Z0-9]{1,8})[/ ]([A-Z]{2})[- ]?([0-9]{3}|xxx|\?\?\?)$/i let matches = this.summitCode.match(summitRegex) if (matches) { this.summitCode = (matches[1] + '/' + matches[2] + '-' + matches[3]).toUpperCase() - if (matches[3].toUpperCase() === 'XXX') { + if (matches[2].toUpperCase() === 'XX' || matches[2] === '??' || matches[3].toUpperCase() === 'XXX' || matches[3] === '???') { this.summitInvalid = false this.summitCodeXxx = true this.summit = null