Fix displaying scheduled's empty placeholder
This commit is contained in:
parent
c2b1326bd8
commit
fdd4232fcc
@ -72,7 +72,7 @@ export default class AppSelectPeers {
|
|||||||
|
|
||||||
private placeholder: LangPackKey;
|
private placeholder: LangPackKey;
|
||||||
|
|
||||||
private selfPresence: LangPackKey = 'Presence.YourChat'
|
private selfPresence: LangPackKey = 'Presence.YourChat';
|
||||||
|
|
||||||
private needSwitchList = false;
|
private needSwitchList = false;
|
||||||
|
|
||||||
|
@ -2892,15 +2892,20 @@ export default class ChatBubbles {
|
|||||||
if(reverse) for(let i = 0; i < length; ++i) cb(history[i]);
|
if(reverse) for(let i = 0; i < length; ++i) cb(history[i]);
|
||||||
else for(let i = length - 1; i >= 0; --i) cb(history[i]);
|
else for(let i = length - 1; i >= 0; --i) cb(history[i]);
|
||||||
|
|
||||||
const historyStorage = this.appMessagesManager.getHistoryStorage(this.peerId, this.chat.threadId);
|
if(this.chat.type !== 'scheduled') {
|
||||||
const firstSlice = historyStorage.history.first;
|
const historyStorage = this.appMessagesManager.getHistoryStorage(this.peerId, this.chat.threadId);
|
||||||
const lastSlice = historyStorage.history.last;
|
const firstSlice = historyStorage.history.first;
|
||||||
if(firstSlice.isEnd(SliceEnd.Bottom) && (!firstSlice.length || history.includes(firstSlice[0]))) {
|
const lastSlice = historyStorage.history.last;
|
||||||
this.setLoaded('bottom', true, false);
|
if(firstSlice.isEnd(SliceEnd.Bottom) && (!firstSlice.length || history.includes(firstSlice[0]))) {
|
||||||
}
|
this.setLoaded('bottom', true, false);
|
||||||
|
}
|
||||||
|
|
||||||
if(lastSlice.isEnd(SliceEnd.Top) && (!lastSlice.length || history.includes(lastSlice[lastSlice.length - 1]))) {
|
if(lastSlice.isEnd(SliceEnd.Top) && (!lastSlice.length || history.includes(lastSlice[lastSlice.length - 1]))) {
|
||||||
this.setLoaded('top', true, false);
|
this.setLoaded('top', true, false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.setLoaded('top', true);
|
||||||
|
this.setLoaded('bottom', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.messagesQueuePromise;//.then(() => new Promise(resolve => setTimeout(resolve, 100)))
|
await this.messagesQueuePromise;//.then(() => new Promise(resolve => setTimeout(resolve, 100)))
|
||||||
@ -2985,8 +2990,8 @@ export default class ChatBubbles {
|
|||||||
return promise;
|
return promise;
|
||||||
} else if(this.chat.type === 'scheduled') {
|
} else if(this.chat.type === 'scheduled') {
|
||||||
return this.appMessagesManager.getScheduledMessages(this.peerId).then(mids => {
|
return this.appMessagesManager.getScheduledMessages(this.peerId).then(mids => {
|
||||||
this.setLoaded('top', true);
|
// this.setLoaded('top', true);
|
||||||
this.setLoaded('bottom', true);
|
// this.setLoaded('bottom', true);
|
||||||
return {history: mids.slice().reverse()};
|
return {history: mids.slice().reverse()};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -3347,7 +3352,8 @@ export default class ChatBubbles {
|
|||||||
(
|
(
|
||||||
Object.keys(this.bubbles).length &&
|
Object.keys(this.bubbles).length &&
|
||||||
!this.getRenderedLength()
|
!this.getRenderedLength()
|
||||||
)
|
) ||
|
||||||
|
(this.chat.type === 'scheduled' && !Object.keys(this.bubbles).length)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
this.log('inject empty peer placeholder');
|
this.log('inject empty peer placeholder');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user