Skip to content

Commit

Permalink
Fix cannot get my post author
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Jul 5, 2019
1 parent fc43e85 commit 071418b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/extension/content-script/injections/MyUsername.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ export function getPersonIdentifierAtFacebook(links: link[] | link): PersonIdent
try {
// tslint:disable-next-line: no-parameter-reassignment
if (!Array.isArray(links)) links = [links]
const [link] = links
if (link === null || link === undefined) return PersonIdentifier.unknown
const id = getUserID(link.href)
const [id] = links
.filter(x => x)
.map(x => getUserID(x!.href))
.filter(x => x)
if (id) return new PersonIdentifier('facebook.com', id)
return PersonIdentifier.unknown
} catch (e) {
console.error(e)
}
Expand Down

0 comments on commit 071418b

Please sign in to comment.