Do not try to display share status until map is created

This commit is contained in:
Yohan Boniface 2023-08-15 22:36:11 +02:00
parent b06cfca1f2
commit 26b3b4b5c7

View file

@ -983,9 +983,11 @@ L.U.Map.include({
name = L.DomUtil.create('a', 'map-name', container), name = L.DomUtil.create('a', 'map-name', container),
share_status = L.DomUtil.create('a', 'share-status', container), share_status = L.DomUtil.create('a', 'share-status', container),
update = () => { update = () => {
const status = this.permissions.getShareStatusDisplay()
name.textContent = this.getDisplayName() name.textContent = this.getDisplayName()
share_status.textContent = L._('Visibility: {status}', { // status is not set until map is saved once
status: this.permissions.getShareStatusDisplay(), if (status) share_status.textContent = L._('Visibility: {status}', {
status: status,
}) })
} }
update() update()