From e394a92dcbae7c14650f98661e5c6d15902de623 Mon Sep 17 00:00:00 2001 From: Aryan Github <34622095+Aryanamish@users.noreply.github.com> Date: Fri, 2 Dec 2022 15:57:28 +0530 Subject: [PATCH] fixed issue where large image would render in different env #80 Updated the backend to send envID with the render information. Updated the Front End to ignore the incoming window when it is not in the current selected environment --- js/main.js | 8 ++++++++ py/visdom/utils/server_utils.py | 1 + 2 files changed, 9 insertions(+) diff --git a/js/main.js b/js/main.js index 9b814af8..f8b4431f 100644 --- a/js/main.js +++ b/js/main.js @@ -472,6 +472,14 @@ class App extends React.Component { // If we're in compare mode and recieve an update to an environment // that is selected that isn't from the compare output, we need to // reload the compare output + if(cmd.envID !== undefined && cmd.envID !== this.state.envID){ + // If env of the window is not same to the current env then ignore it + break; + } + if(cmd.contentID === 'compare_legend' && this.state.envIDs.length < 2){ + // if compare_legend comes and only one env is selected then ignore it + break; + } if (this.state.envIDs.length > 1 && cmd.has_compare !== true) { this.postForEnv(this.state.envIDs); } else { diff --git a/py/visdom/utils/server_utils.py b/py/visdom/utils/server_utils.py index 6a81fc88..058b9679 100644 --- a/py/visdom/utils/server_utils.py +++ b/py/visdom/utils/server_utils.py @@ -182,6 +182,7 @@ def window(args): 'inflate': opts.get('inflate', True), 'width': opts.get('width'), 'height': opts.get('height'), + 'envID': args.get('eid'), 'contentID': get_rand_id(), # to detected updated windows }