diff --git a/packages/hydrooj/src/handler/record.ts b/packages/hydrooj/src/handler/record.ts index 9eae08f9..880d8351 100644 --- a/packages/hydrooj/src/handler/record.ts +++ b/packages/hydrooj/src/handler/record.ts @@ -364,6 +364,7 @@ class RecordDetailConnectionHandler extends ConnectionHandler { async sendUpdate(rdoc: RecordDoc) { this.send({ + status: rdoc.status, status_html: await this.renderHTML('record_detail_status.html', { rdoc, pdoc: this.pdoc }), summary_html: await this.renderHTML('record_detail_summary.html', { rdoc, pdoc: this.pdoc }), }); diff --git a/packages/ui-default/pages/record_detail.page.ts b/packages/ui-default/pages/record_detail.page.ts index a6972277..b4df9c89 100644 --- a/packages/ui-default/pages/record_detail.page.ts +++ b/packages/ui-default/pages/record_detail.page.ts @@ -18,6 +18,7 @@ const page = new NamedPage('record_detail', async () => { const newSummary = $(msg.summary_html); const oldSummary = $('#summary'); dd.apply(oldSummary[0], dd.diff(oldSummary[0], newSummary[0])); + if (typeof msg.status === 'number' && window.parent) window.parent.postMessage({ status: msg.status }); }; });