From 913d2c06f35c76e8bcab0f551e33e01ae1b9e1ec Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 10 Jan 2022 17:15:21 +0100 Subject: [PATCH] start sync immediately after sharing/unsharing, fixes #2539 --- src/public/app/widgets/shared_switch.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/shared_switch.js b/src/public/app/widgets/shared_switch.js index 46aee2cb3..e2664bdcc 100644 --- a/src/public/app/widgets/shared_switch.js +++ b/src/public/app/widgets/shared_switch.js @@ -2,6 +2,7 @@ import SwitchWidget from "./switch.js"; import branchService from "../services/branches.js"; import server from "../services/server.js"; import utils from "../services/utils.js"; +import syncService from "../services/sync.js"; export default class SharedSwitchWidget extends SwitchWidget { isEnabled() { @@ -21,8 +22,10 @@ export default class SharedSwitchWidget extends SwitchWidget { this.$helpButton.on('click', e => utils.openHelp(e)); } - switchOn() { - branchService.cloneNoteToNote(this.noteId, 'share'); + async switchOn() { + await branchService.cloneNoteToNote(this.noteId, 'share'); + + syncService.syncNow(); } async switchOff() { @@ -43,6 +46,8 @@ export default class SharedSwitchWidget extends SwitchWidget { } await server.remove(`branches/${shareBranch.branchId}?taskId=no-progress-reporting`); + + syncService.syncNow(); } async refreshWithNote(note) {