mirror of
https://github.com/NicolasConstant/sengi
synced 2024-12-22 13:54:10 +01:00
filter on uri only if multiple results
This commit is contained in:
parent
ec27b307d0
commit
565717debc
@ -167,7 +167,12 @@ export class ThreadComponent extends BrowseBase {
|
||||
return this.mastodonService.search(currentAccount, status.uri, version, true);
|
||||
})
|
||||
.then((result: Results) => {
|
||||
const retrievedStatus = result.statuses.find(({ uri }) => uri === status.uri);
|
||||
let retrievedStatus: Status = null;
|
||||
if (result.statuses.length === 1) {
|
||||
retrievedStatus = result.statuses[0];
|
||||
} else if(result.statuses.length > 1){
|
||||
retrievedStatus = result.statuses.find(({ uri }) => uri === status.uri);
|
||||
}
|
||||
if (retrievedStatus) {
|
||||
return retrievedStatus;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user