cleanup: Get rid of magic const (subscriptionId) in webapp App.jsx

This commit is contained in:
John Colvin committed 2024-09-18 14:02:37 +00:00
1 parent ad0b6968ad
commit 68f75a6f44
1 file changed
+6 -2
@@ -15,6 +15,10 @@ import './App.css';
import './SideBar.css';
const webSocketUrl = import.meta.env.VITE_DATASTREAM_WEBSOCKET_URL;
// Always use the same subscription id (1), because we only show 1 table at a time.
// The server will automatically dispose the previous subscription and start a new one
// if we're currently subscribed to another query.
const subscriptionId = "1";
var rpcReqIdCounter = 1;
@@ -24,7 +28,7 @@ function subscribeReq(query) {
id: rpcReqIdCounter++,
method: "subscribe",
params: {
subscription_id: "1",
subscription_id: subscriptionId,
query: query
}
};
@@ -36,7 +40,7 @@ function unsubscribeReq() {
id: rpcReqIdCounter++,
method: "unsubscribe",
params: {
subscription_id: "1",
subscription_id: subscriptionId,
}
};
}