diff --git a/umap/static/umap/js/modules/ui/bar.js b/umap/static/umap/js/modules/ui/bar.js index c08f327c6..80202616a 100644 --- a/umap/static/umap/js/modules/ui/bar.js +++ b/umap/static/umap/js/modules/ui/bar.js @@ -145,7 +145,9 @@ export class TopBar extends WithTemplate { } redraw() { - this.elements.peers.hidden = !this._umap.getProperty('syncEnabled') + const syncEnabled = this._umap.getProperty('syncEnabled') + this.elements.peers.hidden = !syncEnabled + this.elements.cancel.hidden = syncEnabled this.elements.saveLabel.hidden = this._umap.permissions.isDraft() this.elements.saveDraftLabel.hidden = !this._umap.permissions.isDraft() } diff --git a/umap/static/umap/js/modules/umap.js b/umap/static/umap/js/modules/umap.js index f1e8541ae..57ffc46b1 100644 --- a/umap/static/umap/js/modules/umap.js +++ b/umap/static/umap/js/modules/umap.js @@ -1259,6 +1259,7 @@ export default class Umap extends ServerStored { } askForReset(e) { + if (this.getProperty('syncEnabled')) return this.dialog .confirm(translate('Are you sure you want to cancel your changes?')) .then(() => {