feat: send progress events during sync

This commit is contained in:
thecodrr
2022-02-08 15:09:39 +05:00
parent bb675e9da2
commit fb0c30ecca
2 changed files with 17 additions and 2 deletions

View File

@@ -19,6 +19,14 @@ export function sendAttachmentsProgressEvent(type, groupId, total, current) {
});
}
export function sendSyncProgressEvent(type, total, current) {
EV.publish(EVENTS.syncProgress, {
type,
total,
current: current === undefined ? total : current,
});
}
export const CLIENT_ID = "notesnook";
export const CHECK_IDS = {
@@ -41,6 +49,7 @@ export const EVENTS = {
userSignedUp: "user:signedUp",
userSessionExpired: "user:sessionExpired",
databaseSyncRequested: "db:syncRequested",
syncProgress: "sync:progress",
databaseMigrated: "db:migrated",
databaseUpdated: "db:updated",
databaseCollectionInitiated: "db:collectionInitiated",