From 631590e7f98496fc82e824af0412bee23807224c Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 15 May 2024 16:32:42 +0200 Subject: [PATCH] fix --- django/frontend/static/js/api/Notice.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/django/frontend/static/js/api/Notice.js b/django/frontend/static/js/api/Notice.js index 3fddc06..049ce1b 100644 --- a/django/frontend/static/js/api/Notice.js +++ b/django/frontend/static/js/api/Notice.js @@ -3,6 +3,7 @@ import {createNotification} from '../utils/noticeUtils.js' import { lastView, navigateTo } from '../index.js'; import ProfilePageView from '../views/ProfilePageView.js'; import Search from '../views/Search.js'; +import { sleep } from '../utils/sleep.js'; export default class Notice { @@ -48,11 +49,9 @@ export default class Notice { stop() { if (this._socket) { - try{ - this._socket.close(); - } - catch (e) - {} + while (this._socket.OPEN) + sleep(100); + this._socket.close() this._socket = undefined; } }