fix provider check for remote status

This commit is contained in:
Nicolas Constant 2020-04-06 22:06:36 -04:00
parent ce705f8c6b
commit 68dd97e5a9
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 6 additions and 3 deletions

View File

@ -131,7 +131,7 @@ export class ThreadComponent implements OnInit, OnDestroy {
if (status.visibility === 'public' || status.visibility === 'unlisted') {
var statusPromise: Promise<Status> = Promise.resolve(status);
if (sourceAccount.id !== currentAccount.id) {
if (!sourceAccount || sourceAccount.id !== currentAccount.id) {
statusPromise = this.toolsService.getInstanceInfo(currentAccount)
.then(instance => {
let version: 'v1' | 'v2' = 'v1';
@ -149,7 +149,7 @@ export class ThreadComponent implements OnInit, OnDestroy {
this.retrieveThread(currentAccount, statusPromise);
} else if (sourceAccount.id === currentAccount.id) {
} else if (sourceAccount && sourceAccount.id === currentAccount.id) {
var statusPromise = Promise.resolve(status);
this.retrieveThread(currentAccount, statusPromise);
} else {

View File

@ -205,7 +205,10 @@ export class ToolsService {
}
getStatusUsableByAccount(account: AccountInfo, originalStatus: StatusWrapper): Promise<Status> {
const isProvider = originalStatus.provider.id === account.id;
let isProvider = false;
if(!originalStatus.isRemote){
isProvider = originalStatus.provider.id === account.id;
}
let statusPromise: Promise<Status> = Promise.resolve(originalStatus.status);