fix list flicking in account panel

This commit is contained in:
Nicolas Constant 2020-05-01 01:32:25 -04:00
parent 16ea7205dd
commit 8d9895b0c9
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 9 additions and 5 deletions

View File

@ -104,18 +104,22 @@ export class MyAccountComponent implements OnInit, OnDestroy {
}
});
this.availableLists.length = 0;
// this.availableLists.length = 0;
this.mastodonService.getLists(account.info)
.then((streams: StreamElement[]) => {
this.availableLists.length = 0;
// this.availableLists.length = 0;
for (let stream of streams) {
let wrappedStream = new StreamWrapper(stream);
let wrappedStream = this.availableLists.find(x => x.id === stream.id);
if(!wrappedStream){
wrappedStream = new StreamWrapper(stream);
this.availableLists.push(wrappedStream);
}
if(loadedStreams.find(x => x.id == stream.id)){
wrappedStream.isAdded = true;
} else {
wrappedStream.isAdded = false;
}
this.availableLists.push(wrappedStream);
}
}
})
.catch(err => {