Skip to content

Commit

Permalink
fix(wslink): Update to 1.0.6 api change
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Aug 23, 2021
1 parent 1990880 commit edac527
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
19 changes: 4 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"tape-catch": "1.0.6",
"tonic-arctic-sample-data": "http://www.paraview.org/files/dependencies/tonic-arctic-sample-data-1.2.2.tgz",
"vtk.js": "19.2.2",
"wslink": "0.1.15"
"wslink": "1.0.6"
},
"scripts": {
"install": "./config/prebuild.sh",
Expand Down
8 changes: 6 additions & 2 deletions src/Common/Misc/SizeHelper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ function getSize(domElement, clearCache = false) {

class Subscriber {
constructor(domElement, callback) {
observer.observe(domElement);
if (domElement) {
observer.observe(domElement);
}
this.fn = observableInstance.on(TOPIC, callback);
this.domElement = domElement;
}

unsubscribe() {
observer.unobserve(this.domElement);
if (this.domElement) {
observer.unobserve(this.domElement);
}
this.fn.unsubscribe();
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/IO/WebSocket/WslinkImageStream/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function wslinkImageStream(publicAPI, model) {
publicAPI.unsubscribeRenderTopic = () => {
model.client.VtkImageDelivery.offRenderChange(
model.renderTopicSubscription
).then(
).promise.then(
(unsubSuccess) => {
console.log('Unsubscribe resolved ', unsubSuccess);
},
Expand Down Expand Up @@ -153,7 +153,9 @@ function wslinkImageStream(publicAPI, model) {
model.width = size[0];
model.height = size[1];

model.client.VtkImageDelivery.onRenderChange(publicAPI.viewChanged).then(
model.client.VtkImageDelivery.onRenderChange(
publicAPI.viewChanged
).promise.then(
(subscription) => {
model.renderTopicSubscription = subscription;
model.client.VtkImageDelivery.addRenderObserver(view_id).then(
Expand Down

0 comments on commit edac527

Please sign in to comment.