From 3bda79cc8b28d7060ccf44f22568de8ef0bb6436 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 11 Apr 2020 08:50:46 +0200 Subject: [PATCH] Fix error for disconnected users --- assets/js/components/posts/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index bd9703c3..5105c370 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -903,7 +903,8 @@ ComunicWeb.components.posts.ui = { ComunicWeb.components.comments.ui.display(info.comments, info.ID, postRoot); // Register for post updates - PostsInterface.register(info.ID); + if(UserWebSocket.IsConnected) + PostsInterface.register(info.ID); // Auto-unregister when the post goes out of scope const ev = async (e) => {