mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Implement 'isPreparedForMarkers' and set a watcher, because sometimes the current users pin is missing
This commit is contained in:
parent
81f2840a95
commit
0f21a92a84
@ -117,6 +117,15 @@ export default {
|
||||
...mapGetters({
|
||||
currentUser: 'auth/user',
|
||||
}),
|
||||
isPreparedForMarkers() {
|
||||
return (
|
||||
!this.markers.isGeoJSON &&
|
||||
this.markers.isImagesLoaded &&
|
||||
this.currentUser &&
|
||||
this.users &&
|
||||
this.groups
|
||||
)
|
||||
},
|
||||
styles() {
|
||||
return objectValuesToArray(this.availableStyles)
|
||||
},
|
||||
@ -160,6 +169,13 @@ export default {
|
||||
return this.currentUserCoordinates ? 10 : 4
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isPreparedForMarkers(newValue) {
|
||||
if (newValue) {
|
||||
this.addMarkersOnCheckPrepared()
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onMapLoad({ map }) {
|
||||
this.map = map
|
||||
@ -293,13 +309,7 @@ export default {
|
||||
},
|
||||
addMarkersOnCheckPrepared() {
|
||||
// set geoJSON for markers
|
||||
if (
|
||||
!this.markers.isGeoJSON &&
|
||||
this.markers.isImagesLoaded &&
|
||||
this.currentUser &&
|
||||
this.users &&
|
||||
this.groups
|
||||
) {
|
||||
if (this.isPreparedForMarkers) {
|
||||
// add markers for "users"
|
||||
this.users.forEach((user) => {
|
||||
if (user.id !== this.currentUser.id && user.location) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user