reduced dependencies of utils

This commit is contained in:
azivner
2018-03-25 21:29:35 -04:00
parent ac1b06967f
commit d3316cd09c
17 changed files with 93 additions and 85 deletions

View File

@@ -1,17 +1,18 @@
import utils from './utils.js';
import infoService from "./info.js";
async function syncNow() {
const result = await server.post('sync/now');
if (result.success) {
utils.showMessage("Sync finished successfully.");
infoService.showMessage("Sync finished successfully.");
}
else {
if (result.message.length > 50) {
result.message = result.message.substr(0, 50);
}
utils.showError("Sync failed: " + result.message);
infoService.showError("Sync failed: " + result.message);
}
}
@@ -20,7 +21,7 @@ $("#sync-now-button").click(syncNow);
async function forceNoteSync(noteId) {
const result = await server.post('sync/force-note-sync/' + noteId);
utils.showMessage("Note added to sync queue.");
infoService.showMessage("Note added to sync queue.");
}
export default {