Fix usage of wrong streaming buffer in frontend

This commit is contained in:
James 2018-08-07 15:39:24 +10:00 committed by James Lonie
parent b32e9f6f33
commit d4dd3fb182

View File

@ -77,14 +77,12 @@ function stream_ajax(path, callback, successCallback, failCallback, data) {
req.onreadystatechange = function() {
if(req.readyState > 2) {
var newData = req.responseText.substr(req.seenBytes);
buffer += newData;
buffer += req.responseText.substr(req.seenBytes);
var pointer;
while ((pointer = newData.indexOf("\n")) >= 0) {
var line = newData.substring(0, pointer).trim();
newData = newData.substring(pointer + 1);
while ((pointer = buffer.indexOf("\n")) >= 0) {
var line = buffer.substring(0, pointer).trim();
buffer = buffer.substring(pointer + 1);
if (line.length === 0) {
continue;