mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'stable'
This commit is contained in:
commit
d1941cc650
@ -9,6 +9,7 @@ import noteDetailService from "./note_detail.js";
|
|||||||
import keyboardActionService from "./keyboard_actions.js";
|
import keyboardActionService from "./keyboard_actions.js";
|
||||||
import hoistedNoteService from "./hoisted_note.js";
|
import hoistedNoteService from "./hoisted_note.js";
|
||||||
import treeCache from "./tree_cache.js";
|
import treeCache from "./tree_cache.js";
|
||||||
|
import server from "./server.js";
|
||||||
|
|
||||||
const NOTE_REVISIONS = "../dialogs/note_revisions.js";
|
const NOTE_REVISIONS = "../dialogs/note_revisions.js";
|
||||||
const OPTIONS = "../dialogs/options.js";
|
const OPTIONS = "../dialogs/options.js";
|
||||||
@ -232,15 +233,16 @@ function registerEntrypoints() {
|
|||||||
|
|
||||||
keyboardActionService.setGlobalActionHandler("CreateNoteIntoDayNote", async () => {
|
keyboardActionService.setGlobalActionHandler("CreateNoteIntoDayNote", async () => {
|
||||||
const todayNote = await dateNoteService.getTodayNote();
|
const todayNote = await dateNoteService.getTodayNote();
|
||||||
const notePath = await treeService.getSomeNotePath(todayNote);
|
|
||||||
|
|
||||||
const node = await treeService.expandToNote(notePath);
|
const {note} = await server.post(`notes/${todayNote.noteId}/children?target=into`, {
|
||||||
|
title: 'new note',
|
||||||
const {note} = await treeService.createNote(node, todayNote.noteId, 'into', {
|
content: '',
|
||||||
type: "text",
|
type: 'text',
|
||||||
isProtected: node.data.isProtected
|
isProtected: todayNote.isProtected
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await treeService.expandToNote(note.noteId);
|
||||||
|
|
||||||
await noteDetailService.openInTab(note.noteId, true);
|
await noteDetailService.openInTab(note.noteId, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -129,9 +129,10 @@ class NoteDetailRelationMap {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const {note} = await server.post(`notes/${this.ctx.note.noteId}/children`, {
|
const {note} = await server.post(`notes/${this.ctx.note.noteId}/children?target=into`, {
|
||||||
title,
|
title,
|
||||||
target: 'into'
|
content: '',
|
||||||
|
type: 'text'
|
||||||
});
|
});
|
||||||
|
|
||||||
toastService.showMessage("Click on canvas to place new note");
|
toastService.showMessage("Click on canvas to place new note");
|
||||||
|
@ -172,7 +172,7 @@ function connectWebSocket() {
|
|||||||
|
|
||||||
async function sendPing() {
|
async function sendPing() {
|
||||||
if (Date.now() - lastPingTs > 30000) {
|
if (Date.now() - lastPingTs > 30000) {
|
||||||
console.log(utils.now(), "Lost connection to server");
|
console.log(utils.now(), "Lost websocket connection to the backend");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ws.readyState === ws.OPEN) {
|
if (ws.readyState === ws.OPEN) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user