diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-03-18 17:42:36 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2019-03-18 17:42:36 +0300 |
commit | a5cc5f6b35b79ec8feb0bcbe15715e86e1d2ebdb (patch) | |
tree | 461900cffd0e72d4aee9a5635ab5706418965ba7 /src | |
parent | 23f04061d90d71fd014a7e2b813a8c10befcffb0 (diff) |
Fix display if no country is selected yet - fixes #49
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/Location.vue | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Location.vue b/src/Location.vue index aa0a97d..b59c769 100644 --- a/src/Location.vue +++ b/src/Location.vue @@ -3,7 +3,8 @@ <span v-show="isLoading" class="icon icon-loading" /> <Map v-show="!isLoading" /> <p v-show="!isEditingLocation && !isLoading"> - {{ label }}<strong>{{ country }}.</strong> + <span v-show="country">{{ label }}<strong>{{ country }}.</strong></span> + <span v-show="!country">{{ labelForNoCountry }}</span> <span v-show="isAdmin" class="icon icon-rename" @click="editLocation" /> </p> <div v-show="isEditingLocation && !isLoading" class="multiselect-container"> @@ -49,6 +50,9 @@ export default { label() { return t('privacy', 'Your data is located in: ') }, + labelForNoCountry() { + return t('privacy', 'The admin hasn\'t selected the location of the server yet.') + }, country() { return getNameForCountryCode(this.$data.selectedCountry) }, @@ -79,9 +83,11 @@ export default { HttpClient.get(url).then(resp => { this.selectedCountry = resp.data.code - const elm = document.querySelector('.where-is-my-data #' + this.selectedCountry) - if (elm) { - elm.style.fill = '#e6605c' + if (this.selectedCountry !== '') { + const elm = document.querySelector('.where-is-my-data #' + this.selectedCountry) + if (elm) { + elm.style.fill = '#e6605c' + } } this.isLoading = false |