Browse Source

Fixed following by unread

master
morethanwords 4 years ago
parent
commit
b720951241
  1. 4
      src/lib/appManagers/appImManager.ts
  2. 2
      src/lib/appManagers/appMessagesManager.ts

4
src/lib/appManagers/appImManager.ts

@ -2796,7 +2796,7 @@ export class AppImManager { @@ -2796,7 +2796,7 @@ export class AppImManager {
if(result instanceof Promise) {
cached = false;
promise = result.then((result) => {
this.log('getHistory not cached result by maxID:', maxID, reverse, isBackLimit, result, peerID);
this.log('getHistory not cached result by maxID:', maxID, reverse, isBackLimit, result, peerID, justLoad);
if(justLoad) {
this.scrollable.onScroll(); // нужно делать из-за ранней прогрузки
@ -2821,7 +2821,7 @@ export class AppImManager { @@ -2821,7 +2821,7 @@ export class AppImManager {
return null;
} else {
cached = true;
this.log('getHistory cached result by maxID:', maxID, reverse, isBackLimit, result, peerID);
this.log('getHistory cached result by maxID:', maxID, reverse, isBackLimit, result, peerID, justLoad);
promise = this.performHistoryResult(result.history || [], reverse, isBackLimit, additionMsgID);
//return (reverse ? this.getHistoryTopPromise = promise : this.getHistoryBottomPromise = promise);
//return this.performHistoryResult(result.history || [], reverse, isBackLimit, additionMsgID, true);

2
src/lib/appManagers/appMessagesManager.ts

@ -4166,7 +4166,7 @@ export class AppMessagesManager { @@ -4166,7 +4166,7 @@ export class AppMessagesManager {
}
}
var history = historyStorage.history.slice(offset, offset + limit);
let history = historyStorage.history.slice(backLimit ? Math.max(offset - backLimit, 0) : offset, offset + limit);
if(!maxID && historyStorage.pending.length) {
history = historyStorage.pending.slice().concat(history);
}

Loading…
Cancel
Save