mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix: request sync before sse connects
(fixes streetwriters/notesnook#465)
This commit is contained in:
@@ -146,6 +146,7 @@ class Database {
|
|||||||
async connectSSE(args) {
|
async connectSSE(args) {
|
||||||
await this.sseMutex.runExclusive(async () => {
|
await this.sseMutex.runExclusive(async () => {
|
||||||
if (args && !!args.error) return;
|
if (args && !!args.error) return;
|
||||||
|
this.eventManager.publish(EVENTS.databaseSyncRequested, true, false);
|
||||||
|
|
||||||
const forceReconnect = args && args.force;
|
const forceReconnect = args && args.force;
|
||||||
if (
|
if (
|
||||||
@@ -164,7 +165,6 @@ class Database {
|
|||||||
|
|
||||||
this.evtSource.onopen = async () => {
|
this.evtSource.onopen = async () => {
|
||||||
console.log("SSE: opened channel successfully!");
|
console.log("SSE: opened channel successfully!");
|
||||||
this.eventManager.publish(EVENTS.databaseSyncRequested, true, false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.evtSource.onerror = function (error) {
|
this.evtSource.onerror = function (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user