Disable geolocation on prefered events area selection

Since we restrict to administrative areas and not full addresses

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-03-02 10:02:06 +01:00
parent 3fade65c8e
commit 468c04d24a
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 9 additions and 2 deletions

View file

@ -20,7 +20,7 @@
</template>
</b-autocomplete>
</b-field>
<b-field v-if="isSecureContext()">
<b-field v-if="canDoGeoLocation">
<b-button
type="is-text"
v-if="!gettingLocation"
@ -72,6 +72,8 @@ import { IConfig } from "../../types/config.model";
export default class AddressAutoComplete extends Vue {
@Prop({ required: true }) value!: IAddress;
@Prop({ required: false, default: false }) type!: string | false;
@Prop({ required: false, default: true, type: Boolean })
doGeoLocation!: boolean;
addressData: IAddress[] = [];
@ -244,9 +246,13 @@ export default class AddressAutoComplete extends Vue {
}
// eslint-disable-next-line class-methods-use-this
isSecureContext(): boolean {
get isSecureContext(): boolean {
return window.isSecureContext;
}
get canDoGeoLocation(): boolean {
return this.isSecureContext && this.doGeoLocation;
}
}
</script>
<style lang="scss">

View file

@ -63,6 +63,7 @@
loggedUser && loggedUser.settings && loggedUser.settings.location
"
:type="AddressSearchType.ADMINISTRATIVE"
:doGeoLocation="false"
v-model="address"
>
</address-auto-complete>