Skip to content

Commit d37838d

Browse files
committed
Enable binding of API endpoints during simulation, and only ONCE
1 parent ea8ed2b commit d37838d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

resources/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ function bindMainControls() {
126126
initializing = false;
127127
}
128128

129+
robopaint.api.bindCreateEndpoints();
130+
129131
setModal(false);
130132
});
131133

resources/scripts/main.api.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ robopaint.api.print = {
3131
var printDisabledMessage = 'The SVG import API is currently disabled. Enable it in settings and then click the button in the RoboPaint GUI.';
3232

3333
// Trigger to create all endpoints when endpoint creation is ready
34+
robopaint.api.endpointsBound = false
3435
robopaint.api.bindCreateEndpoints = function(){
36+
if (robopaint.api.endpointsBound) return; // Only bind endpoints ONCE
37+
robopaint.api.endpointsBound = true;
38+
3539
/**
3640
* `robopaint/v1/print` endpoint
3741
* GET - List print queue and current status

0 commit comments

Comments
 (0)