center: add notification push support

This commit is contained in:
undefined committed 2024-08-12 12:34:05 +08:00
1 parent 86dc5dd970
commit 76347fe693
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -63,6 +63,7 @@ class DataReportHandler extends Handler {
sandbox: payload.sandbox,
dbVersion: payload.dbVersion,
};
if (old.notification) setPayload.notification = '';
if (old && lt(payload.version, old.version)) {
await coll.updateOne(
{ _id: installId },
@@ -85,6 +86,7 @@ class DataReportHandler extends Handler {
this.ctx.emit('center/report', this, installId, old, payload);
// TODO deliver messages
this.response.body = { code: 0 };
if (old.notification) this.response.body.notification = old.notification;
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/center",
"version": "0.2.7",
"version": "0.2.8",
"main": "index.ts",
"repository": "https://github.com/hydro-dev/Hydro.git",
"author": "undefined <i@undefined.moe>",