Region flags in game/wrist feeds

This commit is contained in:
Natsumi
2021-06-20 15:32:39 +12:00
parent be6568db38
commit 106d214c8d
4 changed files with 30 additions and 11 deletions

View File

@@ -452,7 +452,7 @@ speechSynthesis.getVoices();
};
Vue.component('location', {
template: '<span>{{ text }}<slot></slot></span>',
template: '<span>{{ text }}<slot></slot><span class="famfamfam-flags" :class="region" style="display:inline-block;margin-left:5px"></span></span>',
props: {
location: String,
hint: {
@@ -462,7 +462,8 @@ speechSynthesis.getVoices();
},
data() {
return {
text: this.location
text: this.location,
region: this.region
};
},
methods: {
@@ -499,6 +500,16 @@ speechSynthesis.getVoices();
this.text = ref.name;
}
}
this.region = '';
if ((this.location !== '') && (!L.isOffline) && (!L.isPrivate)) {
if (L.region === 'eu') {
this.region = 'europeanunion';
} else if (L.region === 'jp') {
this.region = 'jp';
} else {
this.region = 'us';
}
}
}
},
watch: {