Skip to content

Commit

Permalink
Fix: Use 'flag' link if 'hide' not present for faves
Browse files Browse the repository at this point in the history
  • Loading branch information
plibither8 committed Dec 3, 2019
1 parent c832af3 commit 324135f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/features/more-accessible-favorite.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,17 @@ async function storyButtons(metadata) {
for (const item of items) {
const faveButton = item.querySelector('.__rhn__fave-button');

const hideUrl = item.querySelector('a[href^="hide"]').href.replace('?', '&');
const auth = getUrlParams('auth', hideUrl);
const id = getUrlParams('id', hideUrl);
const authStringElement =
item.querySelector('a[href^="flag"]') ||
item.querySelector('a[href^="hide"]');

if (!authStringElement) {
continue;
}

const authStringUrl = authStringElement.href.replace('?', '&');
const auth = getUrlParams('auth', authStringUrl);
const id = getUrlParams('id', authStringUrl);

let unfave = false;

Expand Down

0 comments on commit 324135f

Please sign in to comment.