1
0
mirror of https://github.com/NicolasConstant/sengi synced 2024-12-22 13:54:10 +01:00

Improve status lookup from search

This commit is contained in:
Alex Gleason 2024-08-07 13:25:13 -05:00
parent 822ef21985
commit fc7d8c35ab
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

View File

@ -167,8 +167,8 @@ export class ThreadComponent extends BrowseBase {
return this.mastodonService.search(currentAccount, status.uri, version, true);
})
.then((result: Results) => {
if (result.statuses.length === 1) {
const retrievedStatus = result.statuses[0];
const retrievedStatus = result.statuses.find(({ uri }) => uri === status.uri);
if (retrievedStatus) {
return retrievedStatus;
}
throw new Error('could not find status');