Skip to content

Commit

Permalink
fix(sync): deactivate cancel and hide button when sync is active (#2413)
Browse files Browse the repository at this point in the history
fix #2265

Let's reactivate when we have a proper undo-redo (cf #1107)
  • Loading branch information
yohanboniface authored Jan 1, 2025
2 parents eb50d8a + ddeebd7 commit 4164db3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion umap/static/umap/js/modules/ui/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
1 change: 1 addition & 0 deletions umap/static/umap/js/modules/umap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 4164db3

Please sign in to comment.