Skip to content

Commit

Permalink
Add support for remote collaboration
Browse files Browse the repository at this point in the history
  • Loading branch information
StefansArya committed Mar 12, 2022
1 parent 1671e28 commit 5381eff
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Connection/Extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class ConnectionExtensionData {

_dAppName = 'BP-Polkadot.js';
get dAppName(){return this._dAppName}
set dAppName(val){this._dAppName = val}
set dAppName(val){
this._dAppName = val;

// Already throttled before being synced to remote
this._iface.node.syncOut('dAppName', val);
}
}


Expand Down Expand Up @@ -43,6 +48,12 @@ class ExtensionNode extends Blackprint.Node {
if(!data) return;
Object.assign(this.iface.data, data);
}

// Add support for remote control/collaborative editor mode
syncIn(type, data){
if(type === 'dAppName')
this.iface.data.dAppName = data;
}
});


Expand Down
9 changes: 9 additions & 0 deletions src/Connection/HTTP.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class ConnectionHTTPData {
set rpcURL(val){
this._rpcURL = val;
this._iface.changeRPC();

// Already throttled before being synced to remote
this._iface.node.syncOut('rpcURL', val);
}
}

Expand Down Expand Up @@ -59,6 +62,12 @@ class HTTPNode extends Blackprint.Node {
Object.assign(this.iface.data, data);
}

// Add support for remote control/collaborative editor mode
syncIn(type, data){
if(type === 'rpcURL')
this.iface.data.rpcURL = data;
}

// This will be called by the engine when this node is deleted
destroy(){
let http = this.ref.Output.Provider;
Expand Down
9 changes: 9 additions & 0 deletions src/Connection/WebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class ConnectionWebSocketData {
set rpcURL(val){
this._rpcURL = val;
this._iface.changeRPC();

// Already throttled before being synced to remote
this._iface.node.syncOut('rpcURL', val);
}
}

Expand Down Expand Up @@ -58,6 +61,12 @@ class WebSocketNode extends Blackprint.Node {
Object.assign(this.iface.data, data);
}

// Add support for remote control/collaborative editor mode
syncIn(type, data){
if(type === 'rpcURL')
this.iface.data.rpcURL = data;
}

// This will be called by the engine when this node is deleted
destroy(){
let ws = this.ref.Output.Provider;
Expand Down

0 comments on commit 5381eff

Please sign in to comment.