Skip to content

Commit 0d54f6d

Browse files
committed
Revert usage of current_port
1 parent b3867ca commit 0d54f6d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/vitessce/widget.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,13 @@ def get_uid_str(uid):
169169
// which means that the client needs to prepend the part of the URL before /proxy/8000 such as
170170
// https://hub.gke2.mybinder.org/user/vitessce-vitessce-python-swi31vcv/proxy/8000/A/0/cells
171171
// For workspaces: https://workspaces-pt.hubmapconsortium.org/passthrough/HOSTNAME/PORT/ADDITIONAL_PATH_INFO?QUERY_PARAMS=HELLO_WORLD
172-
function prependBaseUrl(config, proxy, hasHostName, currentPort) {
172+
function prependBaseUrl(config, proxy, hasHostName) {
173173
if (!proxy || hasHostName) {
174174
return config;
175175
}
176176
const { origin, pathname } = new URL(window.location.href);
177177
const isInWorkspaces = origin.startsWith(WORKSPACES_URL_KEYWORD);
178178
179-
const localhostBaseUrl = `http://localhost:${currentPort}`;
180179
const jupyterLabConfigEl = document.getElementById('jupyter-config-data');
181180
182181
let baseUrl;
@@ -403,7 +402,7 @@ def get_uid_str(uid):
403402
function VitessceWidget(props) {
404403
const { model } = props;
405404
406-
const [config, setConfig] = React.useState(prependBaseUrl(model.get('config'), model.get('proxy'), model.get('has_host_name'), model.get('current_port')));
405+
const [config, setConfig] = React.useState(prependBaseUrl(model.get('config'), model.get('proxy'), model.get('has_host_name')));
407406
const [validateConfig, setValidateConfig] = React.useState(true);
408407
const height = model.get('height');
409408
const theme = model.get('theme') === 'auto' ? (prefersDark ? 'dark' : 'light') : model.get('theme');
@@ -591,7 +590,6 @@ class VitessceWidget(anywidget.AnyWidget):
591590
page_mode = Bool(False).tag(sync=True)
592591
page_esm = Unicode('').tag(sync=True)
593592
invoke_timeout = Int(300000).tag(sync=True)
594-
current_port = Int(0).tag(sync=True)
595593

596594
store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
597595

@@ -648,8 +646,7 @@ def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=
648646
plugin_esm=plugin_esm, remount_on_uid_change=remount_on_uid_change,
649647
page_mode=page_mode, page_esm=('' if page_esm is None else page_esm),
650648
invoke_timeout=invoke_timeout,
651-
uid=uid_str, store_urls=list(self._stores.keys()),
652-
current_port=use_port
649+
uid=uid_str, store_urls=list(self._stores.keys())
653650
)
654651

655652
# Register chained plugin on_config_change functions with a change observer.
@@ -755,7 +752,6 @@ def ipython_display(config, height=600, theme='auto', base_url=None, host_name=N
755752
"invoke_timeout": 30000,
756753
"proxy": proxy,
757754
"has_host_name": host_name is not None,
758-
"current_port": use_port,
759755
"height": height,
760756
"theme": theme,
761757
"config": config_dict,

0 commit comments

Comments
 (0)