From ce23950431f8a9e183412870cc604016fe671c90 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 31 Aug 2023 10:13:26 -0400 Subject: [PATCH] handle ping without timestamp --- jdaviz/core/template_mixin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index e0d4ec564f..b3f05cf807 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -276,6 +276,10 @@ def user_api(self): return PluginUserApi(self, expose=[]) def vue_plugin_ping(self, ping_timestamp): + if isinstance(ping_timestamp, dict): + # popout windows can sometimes ping but send an empty dictionary instead of the + # timestamp, in that case, let's set the latest ping time to now + ping_timestamp = time.time() * 1000 self._ping_timestamp = ping_timestamp # we've received a ping, so immediately set plugin_opened state to True