Fix the sort order for private feed

This commit is contained in:
SondreB 2023-01-20 16:22:03 +01:00
parent 7a97afc98d
commit 737c450e0c
No known key found for this signature in database
GPG Key ID: D6CC44C75005FDBF
2 changed files with 1 additions and 11 deletions

View File

@ -230,8 +230,6 @@ export class AppComponent {
return;
}
debugger;
// Sometimes we might discover newer or older profiles, make sure we only update UI dialog if newer.
if (this.discoveredProfileDate < data.created_at) {
this.discoveredProfileDate = data.created_at;

View File

@ -32,15 +32,7 @@ export class FeedPrivateComponent {
pageSize = 12;
currentItems: NostrEventDocument[] = [];
currentItems$ = dexieToRx(liveQuery(() => this.table.offset(this.offset).limit(this.pageSize).toArray())).pipe(
map((data) => {
data.sort((a, b) => {
return a.created_at < b.created_at ? 1 : -1;
});
return data;
})
);
currentItems$ = dexieToRx(liveQuery(() => this.table.orderBy('created_at').offset(this.offset).limit(this.pageSize).toArray()));
items$ = dexieToRx(liveQuery(() => this.items())).pipe(
map((data) => {