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

View File

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