Skip to content

Commit

Permalink
comments: Await modbar before adding removed comment hider (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
eritbh committed Dec 24, 2023
1 parent 26f324a commit bb371a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extension/data/modules/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import TBListener from '../tblistener.js';
import {Module} from '../tbmodule.js';
import * as TBStorage from '../tbstorage.js';
import * as TBui from '../tbui.js';
import {modbarExists} from './modbar.js';

const self = new Module({
name: 'Comments',
Expand Down Expand Up @@ -84,10 +85,14 @@ self.initOldReddit = async function ({hideRemoved, approveComments, spamRemoved,
self.spamRemoved = spamRemoved;
self.hamSpammed = hamSpammed;

function run () {
async function run () {
//
// Do stuff with removed comments
//

// Wait for the modbar to be on the page before we attempt to add to it
await modbarExists;

// Show a removed comments counter when visiting a comment page on a sub where you are moderator. When hiding of removed comments is enabled this doubles as a toggle for that.
let removedCounter = 0;

Expand Down

0 comments on commit bb371a5

Please sign in to comment.