Skip to content

Commit

Permalink
fix: add post icons and watch for flags even if linkDisabled is true
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Aug 21, 2024
1 parent afccd90 commit 2bf0ddb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/AdvancedFlagging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ function setPopoverOpening(
export let page = new Page();

function setupPostPage(): void {
// check if the link + popover should be set up
const linkDisabled = Store.config[Cached.Configuration.linkDisabled];
if (linkDisabled || Page.isLqpReviewPage) return; // do not add the buttons on review
if (Page.isLqpReviewPage) return; // do not add the buttons on review

// split setup into two parts:
// i) append the icons to iconLocation
Expand All @@ -173,10 +171,20 @@ function setupPostPage(): void {
return;
}

const linkDisabled = Store.config[Cached.Configuration.linkDisabled];

page.posts.forEach(post => {
const { id, done, failed, flagged, element } = post;

// even if the user chose to disable AF link,
// the script should still watch for post flags
// and append icons
post.watchForFlags();
if (linkDisabled) {
post.addIcons();

return;
}

// Now append the advanced flagging dropdown
const advancedFlaggingLink = Buttons.makeStacksButton(
Expand Down

0 comments on commit 2bf0ddb

Please sign in to comment.