mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 19:51:57 +08:00
Merge remote-tracking branch 'origin/stable'
This commit is contained in:
commit
da4f26d7ce
4 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
import server from './server.js';
|
||||
import toastService from "./toast.js";
|
||||
|
||||
async function syncNow() {
|
||||
async function syncNow(ignoreNotConfigured = false) {
|
||||
const result = await server.post('sync/now');
|
||||
|
||||
if (result.success) {
|
||||
|
@ -12,7 +12,9 @@ async function syncNow() {
|
|||
result.message = result.message.substr(0, 200) + "...";
|
||||
}
|
||||
|
||||
toastService.showError("Sync failed: " + result.message);
|
||||
if (!ignoreNotConfigured || result.errorCode !== 'NOT_CONFIGURED') {
|
||||
toastService.showError("Sync failed: " + result.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
|||
async switchOn() {
|
||||
await branchService.cloneNoteToNote(this.noteId, 'share');
|
||||
|
||||
syncService.syncNow();
|
||||
syncService.syncNow(true);
|
||||
}
|
||||
|
||||
async switchOff() {
|
||||
|
@ -47,7 +47,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
|||
|
||||
await server.remove(`branches/${shareBranch.branchId}?taskId=no-progress-reporting`);
|
||||
|
||||
syncService.syncNow();
|
||||
syncService.syncNow(true);
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
|
|
|
@ -26,7 +26,7 @@ async function sync() {
|
|||
try {
|
||||
return await syncMutexService.doExclusively(async () => {
|
||||
if (!syncOptions.isSyncSetup()) {
|
||||
return { success: false, message: 'Sync not configured' };
|
||||
return { success: false, errorCode: 'NOT_CONFIGURED', message: 'Sync not configured' };
|
||||
}
|
||||
|
||||
let continueSync = false;
|
||||
|
|
|
@ -41,8 +41,6 @@ function validateParentChild(parentNoteId, childNoteId, branchId = null) {
|
|||
|
||||
const existing = getExistingBranch(parentNoteId, childNoteId);
|
||||
|
||||
console.log("BBBB", existing);
|
||||
|
||||
if (existing && (branchId === null || existing.branchId !== branchId)) {
|
||||
const parentNote = becca.getNote(parentNoteId);
|
||||
const childNote = becca.getNote(childNoteId);
|
||||
|
|
Loading…
Reference in a new issue