activity: do not override location if already exist (when validating new activity)

This commit is contained in:
nobohan 2022-03-03 12:03:22 +01:00
parent d50d68aa86
commit dca17c409b

View File

@ -110,10 +110,8 @@ export default function prepareLocations(store) {
console.log('default loation id', window.default_location_id); console.log('default loation id', window.default_location_id);
if (window.default_location_id) { if (window.default_location_id) {
for (let group of store.state.availableLocations) { for (let group of store.state.availableLocations) {
console.log(group);
let location = group.locations.find((l) => l.id === window.default_location_id); let location = group.locations.find((l) => l.id === window.default_location_id);
console.log(location); if (location !== undefined & store.state.activity.location === null) {
if (location !== undefined) {
store.dispatch('updateLocation', location); store.dispatch('updateLocation', location);
break; break;
} }