@twab/visualization 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1181,12 +1181,13 @@ FramesManager.prototype.goTo = async function (time) {
1181
1181
  this.cancelAllPendingRequests();
1182
1182
 
1183
1183
  this.currentTime = time || this.currentTime;
1184
- const frameIndex = this.findFrameIndexByTime(this.currentTime);
1184
+ const frameIndex = this.findFrameIndexByTime();
1185
1185
 
1186
1186
  if (frameIndex >= 0) {
1187
1187
  this.currentPosition = frameIndex;
1188
1188
  } else {
1189
1189
  this.buffer = [];
1190
+ this.currentPosition = 0;
1190
1191
  await this.getSmallBlock(this.currentTime, this.channel, 1);
1191
1192
  }
1192
1193
  };
@@ -1253,7 +1254,7 @@ FramesManager.prototype.getSmallBlock = async function (
1253
1254
  }
1254
1255
 
1255
1256
  this.orderFramesBlock(images);
1256
- this.currentPosition = this.findFrameIndexByTime(this.currentTime);
1257
+ this.currentPosition = this.findFrameIndexByTime();
1257
1258
 
1258
1259
  delete this.requests[`block_${ENUM.Direction.Next}_${response.end}`];
1259
1260
  delete this.requests[requestId];
@@ -1313,7 +1314,7 @@ FramesManager.prototype.getBlock = async function (
1313
1314
 
1314
1315
  this.orderFramesBlock(response.data.frames, direction === 'Previous');
1315
1316
 
1316
- this.currentPosition = this.findFrameIndexByTime(this.currentTime);
1317
+ this.currentPosition = this.findFrameIndexByTime();
1317
1318
 
1318
1319
  if (checkMinBlock) {
1319
1320
  await this.checkMinBlockSize(!substituition);
@@ -1403,9 +1404,10 @@ FramesManager.prototype.orderFramesBlock = function (
1403
1404
 
1404
1405
  result.sort((a, b) => a.time - b.time);
1405
1406
 
1406
- if (!backwards && !this.checkFramesBackward()) {
1407
- result = result.slice(images.length);
1408
- }
1407
+ //! Verificar um novo método para remover frames desnecessários (está a dar raia no goto)
1408
+ // if (!backwards && !this.checkFramesBackward()) {
1409
+ // result = result.slice(images.length)
1410
+ // }
1409
1411
 
1410
1412
  this.buffer = result;
1411
1413
  } else {
@@ -1413,8 +1415,8 @@ FramesManager.prototype.orderFramesBlock = function (
1413
1415
  }
1414
1416
  };
1415
1417
 
1416
- FramesManager.prototype.findFrameIndexByTime = function (time) {
1417
- return this.buffer.findIndex((frame) => frame.time === time)
1418
+ FramesManager.prototype.findFrameIndexByTime = function () {
1419
+ return this.buffer.findIndex((frame) => frame.time === this.currentTime)
1418
1420
  };
1419
1421
 
1420
1422
  FramesManager.prototype.cancelAllPendingRequests = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twab/visualization",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "main": "dist/visualization.js",
5
5
  "files": [
6
6
  "dist"