Remove workaround, fix 3 second refresh

This commit is contained in:
nathangray 2020-08-26 14:39:39 -06:00
parent 350f375f93
commit ccaf269751
4 changed files with 5 additions and 40 deletions

View File

@ -88,18 +88,6 @@ var et2_dataview_controller = /** @class */ (function () {
}
}
};
/**
* Enable or disable autorefresh
*
* disable_autorefresh is used to detect that we have active push in order to enable a fix for push
* on _insertDataRow function reindexing the _indexMap which is wrong for the full refresh.
*
* @param disabled
* @todo remove it after finding a right fix
*/
et2_dataview_controller.prototype.set_disable_autorefresh = function (disabled) {
this._disable_autorefresh = disabled;
};
/**
* @param value is an object implementing the et2_IDataProvider
* interface
@ -349,9 +337,8 @@ var et2_dataview_controller = /** @class */ (function () {
if (createdRow && _entry.row) {
this._grid.insertRow(_entry.idx, _entry.row);
}
//@todo remove it after finding a right fix
// Update index map only for push (autorefresh disabled)
if (this._disable_autorefresh && this._indexMap[_entry.idx].uid !== _entry.uid) {
if (this._indexMap[_entry.idx].uid !== _entry.uid) {
var max = parseInt(Object.keys(this._indexMap).reduce(function (a, b) { return _this._indexMap[a] > _this._indexMap[b] ? a : b; }));
for (var idx = max; idx >= _entry.idx; idx--) {
var entry = this._indexMap[idx];

View File

@ -62,9 +62,6 @@ export class et2_dataview_controller
private _objectManager: any;
// @todo remove it after finding a right fix
private _disable_autorefresh: boolean;
/**
* Constructor of the et2_dataview_controller, connects to the grid
* callback.
@ -136,20 +133,6 @@ export class et2_dataview_controller
}
}
/**
* Enable or disable autorefresh
*
* disable_autorefresh is used to detect that we have active push in order to enable a fix for push
* on _insertDataRow function reindexing the _indexMap which is wrong for the full refresh.
*
* @param disabled
* @todo remove it after finding a right fix
*/
set_disable_autorefresh( disabled : boolean)
{
this._disable_autorefresh = disabled;
}
/**
* @param value is an object implementing the et2_IDataProvider
* interface
@ -484,9 +467,8 @@ export class et2_dataview_controller
this._grid.insertRow(_entry.idx, _entry.row);
}
//@todo remove it after finding a right fix
// Update index map only for push (autorefresh disabled)
if(this._disable_autorefresh && this._indexMap[_entry.idx].uid !== _entry.uid)
if(this._indexMap[_entry.idx].uid !== _entry.uid)
{
let max = parseInt(Object.keys(this._indexMap).reduce((a, b) => this._indexMap[a] > this._indexMap[b] ? a : b));
for(let idx = max; idx >= _entry.idx; idx--)

View File

@ -1272,7 +1272,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
autoRefresh_1.set_id("nm_autorefresh");
autoRefresh_1.set_select_options({
// Cause [unknown] problems with mail
3: "30 seconds",
30: "30 seconds",
//60: "1 Minute",
180: "3 Minutes",
300: "5 Minutes",
@ -1573,9 +1573,6 @@ var et2_nextmatch = /** @class */ (function (_super) {
*/
et2_nextmatch.prototype.set_disable_autorefresh = function (disabled) {
this.options.disable_autorefresh = disabled;
//@todo remove it after finding a right fix
if (this.controller)
this.controller.set_disable_autorefresh(disabled);
this._set_autorefresh(this._get_autorefresh());
};
/**

View File

@ -1780,7 +1780,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
autoRefresh.set_id("nm_autorefresh");
autoRefresh.set_select_options({
// Cause [unknown] problems with mail
3: "30 seconds",
30: "30 seconds",
//60: "1 Minute",
180: "3 Minutes",
300: "5 Minutes",
@ -2147,8 +2147,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
set_disable_autorefresh( disabled : boolean)
{
this.options.disable_autorefresh = disabled;
//@todo remove it after finding a right fix
if (this.controller) this.controller.set_disable_autorefresh(disabled);
this._set_autorefresh(this._get_autorefresh());
}