').append(await linkService.createNoteLink(childNotePath, {showTooltip: false})))
.append($('
')
.css("max-height", ZOOMS[this.zoomLevel].height)
.append(await this.getNoteContent(type, childNote)));
diff --git a/src/public/javascripts/services/note_detail_file.js b/src/public/javascripts/services/note_detail_file.js
index 0a3dea656..4f91dceb1 100644
--- a/src/public/javascripts/services/note_detail_file.js
+++ b/src/public/javascripts/services/note_detail_file.js
@@ -39,8 +39,11 @@ class NoteDetailFile {
});
this.$uploadNewRevisionInput.on('change', async () => {
+ const fileToUpload = this.$uploadNewRevisionInput[0].files[0]; // copy to allow reset below
+ this.$uploadNewRevisionInput.val('');
+
const formData = new FormData();
- formData.append('upload', this.$uploadNewRevisionInput[0].files[0]);
+ formData.append('upload', fileToUpload);
const result = await $.ajax({
url: baseApiUrl + 'notes/' + this.ctx.note.noteId + '/file',
diff --git a/src/public/javascripts/services/note_detail_image.js b/src/public/javascripts/services/note_detail_image.js
index f877dce48..c0216a40e 100644
--- a/src/public/javascripts/services/note_detail_image.js
+++ b/src/public/javascripts/services/note_detail_image.js
@@ -48,8 +48,11 @@ class NoteDetailImage {
});
this.$uploadNewRevisionInput.on('change', async () => {
+ const fileToUpload = this.$uploadNewRevisionInput[0].files[0]; // copy to allow reset below
+ this.$uploadNewRevisionInput.val('');
+
const formData = new FormData();
- formData.append('upload', this.$uploadNewRevisionInput[0].files[0]);
+ formData.append('upload', fileToUpload);
const result = await $.ajax({
url: baseApiUrl + 'images/' + this.ctx.note.noteId,
diff --git a/src/public/javascripts/services/note_detail_relation_map.js b/src/public/javascripts/services/note_detail_relation_map.js
index 45feb0d92..c46ffde32 100644
--- a/src/public/javascripts/services/note_detail_relation_map.js
+++ b/src/public/javascripts/services/note_detail_relation_map.js
@@ -494,7 +494,7 @@ class NoteDetailRelationMap {
}
async createNoteBox(noteId, title, x, y) {
- const $link = await linkService.createNoteLink(noteId, title);
+ const $link = await linkService.createNoteLink(noteId, {title});
$link.mousedown(e => {
console.log(e);
diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js
index 22461f36a..86aa65fa9 100644
--- a/src/public/javascripts/services/tab_context.js
+++ b/src/public/javascripts/services/tab_context.js
@@ -11,8 +11,6 @@ import protectedSessionService from "./protected_session.js";
import optionsService from "./options.js";
import linkService from "./link.js";
import Sidebar from "./sidebar.js";
-import libraryLoader from "./library_loader.js";
-import noteAutocompleteService from "./note_autocomplete.js";
const $tabContentsContainer = $("#note-tab-container");
@@ -291,6 +289,10 @@ class TabContext {
}
getComponent() {
+ if (!this.components[this.type]) {
+ throw new Error("Could not find component for type: " + this.type);
+ }
+
return this.components[this.type];
}
@@ -377,7 +379,7 @@ class TabContext {
async addPath(notePath, isCurrent) {
const title = await treeUtils.getNotePathTitle(notePath);
- const noteLink = await linkService.createNoteLink(notePath, title);
+ const noteLink = await linkService.createNoteLink(notePath, {title});
noteLink
.addClass("no-tooltip-preview")
diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js
index 28920c6d2..ba8cf9f22 100644
--- a/src/public/javascripts/services/tree.js
+++ b/src/public/javascripts/services/tree.js
@@ -127,16 +127,16 @@ async function getNodeFromPath(notePath, expand = false, expandOpts = {}) {
// we expand only after hoisted note since before then nodes are not actually present in the tree
if (parentNode) {
- checkFolderStatus(parentNode);
-
if (!parentNode.isLoaded()) {
await parentNode.load();
}
if (expand) {
- parentNode.setExpanded(true, expandOpts);
+ await parentNode.setExpanded(true, expandOpts);
}
+ await checkFolderStatus(parentNode);
+
let foundChildNode = findChildNode(parentNode, childNoteId);
if (!foundChildNode) { // note might be recently created so we'll force reload and try again
diff --git a/src/public/javascripts/setup.js b/src/public/javascripts/setup.js
index 4511679b1..65542cc47 100644
--- a/src/public/javascripts/setup.js
+++ b/src/public/javascripts/setup.js
@@ -131,12 +131,15 @@ async function checkOutstandingSyncs() {
const { stats, initialized } = await $.get('api/sync/stats');
if (initialized) {
- window.location.replace("./");
+ const remote = require('electron').remote;
+ remote.app.relaunch();
+ remote.app.exit(0);
}
+ else {
+ const totalOutstandingSyncs = stats.outstandingPushes + stats.outstandingPulls;
- const totalOutstandingSyncs = stats.outstandingPushes + stats.outstandingPulls;
-
- $("#outstanding-syncs").html(totalOutstandingSyncs);
+ $("#outstanding-syncs").html(totalOutstandingSyncs);
+ }
}
function showAlert(message) {
diff --git a/src/public/javascripts/widgets/edited_notes.js b/src/public/javascripts/widgets/edited_notes.js
index ee7dbe793..01ebf07b1 100644
--- a/src/public/javascripts/widgets/edited_notes.js
+++ b/src/public/javascripts/widgets/edited_notes.js
@@ -45,7 +45,7 @@ class EditedNotesWidget extends StandardWidget {
$item.append($("").text(editedNote.title + " (deleted)"));
}
else {
- $item.append(editedNote.notePath ? await linkService.createNoteLinkWithPath(editedNote.notePath.join("/")) : editedNote.title);
+ $item.append(editedNote.notePath ? await linkService.createNoteLink(editedNote.notePath.join("/"), {showNotePath: true}) : editedNote.title);
}
$list.append($item);
diff --git a/src/public/javascripts/widgets/similar_notes.js b/src/public/javascripts/widgets/similar_notes.js
index e4e338032..21e6d2b41 100644
--- a/src/public/javascripts/widgets/similar_notes.js
+++ b/src/public/javascripts/widgets/similar_notes.js
@@ -39,7 +39,7 @@ class SimilarNotesWidget extends StandardWidget {
}
const $item = $("")
- .append(await linkService.createNoteLinkWithPath(similarNote.notePath.join("/")));
+ .append(await linkService.createNoteLink(similarNote.notePath.join("/"), {showNotePath: true}));
$list.append($item);
}
diff --git a/src/public/stylesheets/desktop.css b/src/public/stylesheets/desktop.css
index 02dbbbebe..ec787b29b 100644
--- a/src/public/stylesheets/desktop.css
+++ b/src/public/stylesheets/desktop.css
@@ -57,6 +57,7 @@ body {
}
#left-pane {
+ height: 100%;
display: flex;
flex-direction: column;
}
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index d3544296c..7d81adb82 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -105,6 +105,7 @@ span.fancytree-node.muted { opacity: 0.6; }
flex-direction: column;
flex-grow: 100;
height: 100%;
+ width: 100%;
}
.note-detail-component-wrapper {
diff --git a/src/services/auth.js b/src/services/auth.js
index bb19b9ca1..f1192fa5f 100644
--- a/src/services/auth.js
+++ b/src/services/auth.js
@@ -83,7 +83,7 @@ async function checkBasicAuth(req, res, next) {
const dbUsername = await optionService.getOption('username');
if (dbUsername !== username || !await passwordEncryptionService.verifyPassword(password)) {
- res.status(401).send("Not authorized");
+ res.status(401).send('Incorrect username and/or password');
}
else {
next();