Skip to content

Commit

Permalink
Apparently the battletag numbers can have more than 4 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Oct 31, 2024
1 parent da428b5 commit 59fd33a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ export default defineComponent({
onMounted((): void => {
// Since # is a reserver character for the "fragment/hash" part of the URL
// we can try to redirect to the correct URL if the hash is a battle tag,
// (starts with 4 digits). It may also be followed by a tab name, for
// example Someone#9999/matches would redirect to Someone%239999/matches
if (window.location.hash.match(/^#\d{4}\b/)) {
// (starts with at least 4 digits). It may also be followed by a tab name,
// for example Someone#9999/matches would redirect to Someone%239999/matches
if (window.location.hash.match(/^#\d{4}/)) {
const url = new URL(window.location.href);
url.pathname = `${url.pathname}${url.hash}`;
url.hash = "";
Expand Down

0 comments on commit 59fd33a

Please sign in to comment.