Skip to content

Commit bc4bba2

Browse files
authored
Add key parameter to variable change callbacks (#35)
* Add key parameter to variable change callbacks * Update version
1 parent 92ff2cd commit bc4bba2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
}
2727

2828
group = 'org.team5499'
29-
version = '0.1.2' /* Change this when deploying a new version */
29+
version = '0.1.3' /* Change this when deploying a new version */
3030

3131
task sourcesJar(type: Jar) {
3232
from sourceSets.main.allJava

src/main/resources/static/javascript/page.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ class SocketHandler {
223223
SocketHandler.variables = updates;
224224
for(var u in updates) {
225225
for(var c in SocketHandler.callbacks[u]) {
226-
SocketHandler.callbacks[u][c](updates[u]);
226+
SocketHandler.callbacks[u][c](u, updates[u]);
227227
}
228228
}
229229
} else if(prefix === "updates") {
230230
for(var u in updates) {
231231
SocketHandler.variables[u] = updates[u];
232232
for(var c in SocketHandler.callbacks[u]) {
233-
SocketHandler.callbacks[u][c](updates[u]);
233+
SocketHandler.callbacks[u][c](u, updates[u]);
234234
}
235235
}
236236
}

src/main/resources/static/javascript/widgets/rawvareditor.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ class RawVarEditor extends React.Component {
66
updateName: this.props.variables.target,
77
targetValue: SocketHandler.getVariable(this.props.variables.target) || ""
88
};
9-
this.callbackId = SocketHandler.addVariableListener(this.state.targetName, (value) => this.updateState(value));
9+
this.callbackId = SocketHandler.addVariableListener(this.state.targetName, (key, value) => this.updateState(key, value));
1010
}
1111

12-
updateState(value) {
12+
updateState(key, value) {
1313
this.setState({targetValue: value || ""});
1414
}
1515

0 commit comments

Comments
 (0)