Commit 114e4504 authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH
Browse files

[toolchains] throttle clicking tc blocks to ignore doubleclicks, closes #107

parent b9ff5b63
Pipeline #20110 passed with stages
in 152 minutes and 39 seconds
......@@ -882,16 +882,23 @@ export class ToolchainEditor extends React.PureComponent<Props, State> {
}
}
lastClickMs = 0
// handles left clicking on a block
handleBlockClick = (blockName: string, set: BlockSet) => {
const newMBI = {
set,
name: blockName,
active: true,
};
this.setState({
modalBlockInfo: newMBI,
});
const currTime = Date.now();
// 1sec throttling
const delay = 1000;
if(currTime - this.lastClickMs > delay){
const newMBI = {
set,
name: blockName,
active: true,
};
this.setState({
modalBlockInfo: newMBI,
});
}
this.lastClickMs = currTime;
}
// uses the server's /layout endpoint to get a graphviz layout for this toolchain
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment