File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -969,8 +969,14 @@ export class SearchViewModel {
969969 let startIndex = 0
970970
971971 if ( startId !== GENERATED_MAX_ID ) {
972- // this relies on the results being sorted from newest to oldest ID
973- startIndex = updatedResult . results . findIndex ( ( id ) => id [ 1 ] <= startId )
972+ if ( isOfflineStorageAvailable ( ) ) {
973+ // offline storage is always sorted correctly
974+ startIndex = updatedResult . results . findIndex ( ( id ) => id [ 1 ] === startId )
975+ } else {
976+ // this relies on the results being sorted from newest to oldest ID
977+ startIndex = updatedResult . results . findIndex ( ( id ) => id [ 1 ] <= startId )
978+ }
979+
974980 if ( elementIdPart ( updatedResult . results [ startIndex ] ) === startId ) {
975981 // the start element is already loaded, so we exclude it from the next load
976982 startIndex ++
You can’t perform that action at this time.
0 commit comments