Skip to content

Commit

Permalink
fix: resolveLastRecognizedIdentity partly functional
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka-0x447f committed Sep 19, 2019
1 parent a4ca535 commit ac68f10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/social-network-provider/twitter.com/ui/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ const resolveLastRecognizedIdentity = (self: SocialNetworkUI) => {
const selfSelector = selfInfoSelectors().screenName
const assign = () => {
const ref = self.lastRecognizedIdentity
const info = selfInfoSelectors().screenName.evaluate()
const id = new PersonIdentifier(host, notEmpty(info, 'user id not found'))
if (!id.isUnknown) {
ref.value = { identifier: id }
const screenName = selfInfoSelectors().screenName.evaluate()
const nickname = selfInfoSelectors().name.evaluate()
const avatar = selfInfoSelectors().userAvatar.evaluate()
const identifier = new PersonIdentifier(host, notEmpty(screenName, 'user id not found'))
if (!identifier.isUnknown) {
ref.value = { identifier, nickname, avatar }
}
}
new MutationObserverWatcher(selfSelector)
Expand Down

0 comments on commit ac68f10

Please sign in to comment.