mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 14:55:50 +01:00
Merge branch 'feature/typescript_backend_3' into feature/typescript_backend_4
This commit is contained in:
@@ -29,11 +29,11 @@ let lastSyncedPush: number | null = null;
|
||||
interface Message {
|
||||
type: string;
|
||||
data?: {
|
||||
lastSyncedPush?: number,
|
||||
lastSyncedPush?: number | null,
|
||||
entityChanges?: any[],
|
||||
safeImport?: boolean
|
||||
},
|
||||
lastSyncedPush?: number,
|
||||
lastSyncedPush?: number | null,
|
||||
|
||||
progressCount?: number;
|
||||
taskId?: string;
|
||||
@@ -143,7 +143,7 @@ function fillInAdditionalProperties(entityChange: EntityChange) {
|
||||
if (!entityChange.entity) {
|
||||
entityChange.entity = sql.getRow(`SELECT * FROM notes WHERE noteId = ?`, [entityChange.entityId]);
|
||||
|
||||
if (entityChange.entity && entityChange.entity.isProtected) {
|
||||
if (entityChange.entity?.isProtected) {
|
||||
entityChange.entity.title = protectedSessionService.decryptString(entityChange.entity.title || "");
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ function fillInAdditionalProperties(entityChange: EntityChange) {
|
||||
|
||||
if (parentNote) {
|
||||
for (const childBranch of parentNote.getChildBranches()) {
|
||||
if (childBranch && childBranch.branchId) {
|
||||
if (childBranch?.branchId) {
|
||||
entityChange.positions[childBranch.branchId] = childBranch.notePosition;
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ function sendPing(client: WebSocket, entityChangeIds = []) {
|
||||
sendMessage(client, {
|
||||
type: 'frontend-update',
|
||||
data: {
|
||||
lastSyncedPush: lastSyncedPush || undefined,
|
||||
lastSyncedPush,
|
||||
entityChanges
|
||||
}
|
||||
});
|
||||
@@ -238,19 +238,19 @@ function sendTransactionEntityChangesToAllClients() {
|
||||
}
|
||||
|
||||
function syncPullInProgress() {
|
||||
sendMessageToAllClients({ type: 'sync-pull-in-progress', lastSyncedPush: lastSyncedPush || undefined });
|
||||
sendMessageToAllClients({ type: 'sync-pull-in-progress', lastSyncedPush });
|
||||
}
|
||||
|
||||
function syncPushInProgress() {
|
||||
sendMessageToAllClients({ type: 'sync-push-in-progress', lastSyncedPush: lastSyncedPush || undefined });
|
||||
sendMessageToAllClients({ type: 'sync-push-in-progress', lastSyncedPush });
|
||||
}
|
||||
|
||||
function syncFinished() {
|
||||
sendMessageToAllClients({ type: 'sync-finished', lastSyncedPush: lastSyncedPush || undefined });
|
||||
sendMessageToAllClients({ type: 'sync-finished', lastSyncedPush });
|
||||
}
|
||||
|
||||
function syncFailed() {
|
||||
sendMessageToAllClients({ type: 'sync-failed', lastSyncedPush: lastSyncedPush || undefined });
|
||||
sendMessageToAllClients({ type: 'sync-failed', lastSyncedPush });
|
||||
}
|
||||
|
||||
function reloadFrontend(reason: string) {
|
||||
|
||||
Reference in New Issue
Block a user