Skip to content

Commit

Permalink
temporary fix to prevent calling api too often
Browse files Browse the repository at this point in the history
  • Loading branch information
twobiers committed Jul 6, 2023
1 parent ddecd03 commit 4056195
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/EventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,31 @@ export default class EventHandler {

(function (loaded) {
p.View.Stream.Main.prototype.loaded = function (items, position, error) {
loaded.call(this, items, position, error);
_this.streamLoaded.data = {
items,
position,
error
};
window.dispatchEvent(_this.streamLoaded);

logger.debug("[E] StreamLoaded: ", _this.streamLoaded);
if(p.currentView.classId === 26) {
loaded.call(this, items, position, error);
_this.streamLoaded.data = {
items,
position,
error
};
window.dispatchEvent(_this.streamLoaded);

logger.debug("[E] StreamLoaded: ", _this.streamLoaded);
}
};
}(p.View.Stream.Main.prototype.loaded));

(function (load) {
p.Stream.prototype._load = function (options, callback) {
load.call(this, options, callback);
_this.loadStreamContent.data = {
options
};
window.dispatchEvent(_this.loadStreamContent);

logger.debug("[E] Stream Items Loaded: ", _this.loadStreamContent);
if(p.currentView.classId === 26) {
load.call(this, options, callback);
_this.loadStreamContent.data = {
options
};
window.dispatchEvent(_this.loadStreamContent);

logger.debug("[E] Stream Items Loaded: ", _this.loadStreamContent);
}
};
}(p.Stream.prototype._load));

Expand Down

0 comments on commit 4056195

Please sign in to comment.