Temp commit 2
This commit is contained in:
parent
5fb4ea6670
commit
ffc006557f
@ -110,13 +110,20 @@ export default class SlicedArray {
|
||||
for(let i = 0; i < this.slices.length; ++i) {
|
||||
let offset = 0;
|
||||
const slice = this.slices[i];
|
||||
if(slice.length < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for(; offset < slice.length; offset++) {
|
||||
if(maxId > slice[offset]) {
|
||||
if(!offset) { // because can't find 3 in [[5,4], [2,1]]
|
||||
if(maxId >= slice[offset]) {
|
||||
/* if(!offset) { // because can't find 3 in [[5,4], [2,1]]
|
||||
return undefined;
|
||||
}
|
||||
} */
|
||||
|
||||
return {slice, offset: offset - 1};
|
||||
return {
|
||||
slice,
|
||||
offset: maxId === slice[offset] ? offset : offset - 1
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4664,7 +4664,9 @@ export class AppMessagesManager {
|
||||
});
|
||||
|
||||
const mids = historyResult.messages.map((message) => (message as MyMessage).mid);
|
||||
/* if(maxId && !mids.includes(maxId)) {
|
||||
// * add bound manually.
|
||||
// * offset_id will be inclusive only if there is 'add_offset' <= -1 (-1 - will only include the 'offset_id')
|
||||
if(maxId && !mids.includes(maxId)) {
|
||||
let i = 0;
|
||||
for(const length = mids.length; i < length; ++i) {
|
||||
if(maxId > mids[i]) {
|
||||
@ -4673,7 +4675,7 @@ export class AppMessagesManager {
|
||||
}
|
||||
|
||||
mids.splice(i, 0, maxId);
|
||||
} */
|
||||
}
|
||||
|
||||
historyStorage.history.insertSlice(mids);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user