Skip to content

Commit

Permalink
fix: mobile facebook unable to resolve my identity
Browse files Browse the repository at this point in the history
  • Loading branch information
SunriseFox committed Nov 4, 2019
1 parent 09179ab commit ed1bcbf
Showing 1 changed file with 6 additions and 12 deletions.
Expand Up @@ -38,18 +38,12 @@ const myUsernameLiveSelectorOnMobile = new LiveSelector()
.querySelectorAll('article')
.map(x => x.dataset.store)
.map(x => JSON.parse(x).actor_id as number)
.replace(orig =>
orig.length
? [
orig.reduce((previous, current) => {
if (location.hostname === 'm.facebook.com' && location.pathname === '/') {
if (previous === current) return current
}
return undefined!
}),
]
: [],
)
.filter(x => x)
.replace(orig => {
if (location.hostname === 'm.facebook.com' && location.pathname.match(/^\/(?:home)?[^/]*$/)) {
if (orig.every(x => x === orig[0])) return [orig[0]]
}
return []
})
.map(x => ({ identifier: new PersonIdentifier('facebook.com', x.toString()) } as part))
//#endregion

0 comments on commit ed1bcbf

Please sign in to comment.