Browse Source

Possible fix of saving bad chat state

master
Eduard Kuzmenko 4 years ago
parent
commit
0eb211e0db
  1. 2
      src/lib/appManagers/appImManager.ts

2
src/lib/appManagers/appImManager.ts

@ -249,7 +249,7 @@ export class AppImManager { @@ -249,7 +249,7 @@ export class AppImManager {
const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');
const chatPositions = sessionStorage.getFromCache('chatPositions');
if(!(chat.bubbles.scrollable.getDistanceToEnd() <= 16 && chat.bubbles.scrollable.loadedAll.bottom)) {
if(!(chat.bubbles.scrollable.getDistanceToEnd() <= 16 && chat.bubbles.scrollable.loadedAll.bottom) && Object.keys(chat.bubbles.bubbles).length) {
const position = {
mids: getObjectKeysAndSort(chat.bubbles.bubbles, 'desc'),
top

Loading…
Cancel
Save