mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
start sync immediately after sharing/unsharing, fixes #2539
This commit is contained in:
parent
d04d356429
commit
913d2c06f3
@ -2,6 +2,7 @@ import SwitchWidget from "./switch.js";
|
|||||||
import branchService from "../services/branches.js";
|
import branchService from "../services/branches.js";
|
||||||
import server from "../services/server.js";
|
import server from "../services/server.js";
|
||||||
import utils from "../services/utils.js";
|
import utils from "../services/utils.js";
|
||||||
|
import syncService from "../services/sync.js";
|
||||||
|
|
||||||
export default class SharedSwitchWidget extends SwitchWidget {
|
export default class SharedSwitchWidget extends SwitchWidget {
|
||||||
isEnabled() {
|
isEnabled() {
|
||||||
@ -21,8 +22,10 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
|||||||
this.$helpButton.on('click', e => utils.openHelp(e));
|
this.$helpButton.on('click', e => utils.openHelp(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
switchOn() {
|
async switchOn() {
|
||||||
branchService.cloneNoteToNote(this.noteId, 'share');
|
await branchService.cloneNoteToNote(this.noteId, 'share');
|
||||||
|
|
||||||
|
syncService.syncNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
async switchOff() {
|
async switchOff() {
|
||||||
@ -43,6 +46,8 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await server.remove(`branches/${shareBranch.branchId}?taskId=no-progress-reporting`);
|
await server.remove(`branches/${shareBranch.branchId}?taskId=no-progress-reporting`);
|
||||||
|
|
||||||
|
syncService.syncNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshWithNote(note) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user