Fixed double file request after file upload causing autoscrolling to uploaded file to not work
This commit is contained in:
parent
8aab0ee318
commit
9d69951faa
1 changed files with 5 additions and 0 deletions
|
|
@ -106,13 +106,18 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) {
|
|||
self.isSdReady(data.flags.sdReady);
|
||||
};
|
||||
|
||||
self._otherRequestInProgress = false;
|
||||
self.requestData = function(filenameToFocus, locationToFocus) {
|
||||
if (self._otherRequestInProgress) return;
|
||||
|
||||
self._otherRequestInProgress = true;
|
||||
$.ajax({
|
||||
url: API_BASEURL + "files",
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
self.fromResponse(response, filenameToFocus, locationToFocus);
|
||||
self._otherRequestInProgress = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue