Merge remote-tracking branch 'origin/stable'

This commit is contained in:
zadam 2022-01-13 20:32:37 +01:00
commit da4f26d7ce
4 changed files with 7 additions and 7 deletions

View file

@ -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);
}
}
}

View file

@ -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) {

View file

@ -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;

View file

@ -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);