Skip to content

Commit

Permalink
fix: prevent progress popover from closing
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jun 10, 2024
1 parent fee29c2 commit e6ea22a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ export class Popover {
// if feedback is sent successfully, the success variable is true, otherwise false
const success = await this.post.sendFeedbacks(flagType);

// HACK: this function messes up with our .s-spinner
// disable it temporarily
const old = StackExchange.helpers.removeSpinner;
StackExchange.helpers.removeSpinner = () => {};

// only if the post hasn't been deleted should we
// upvote a comment/send feedback/downvote/flag it
if (!this.post.deleted) {
Expand Down Expand Up @@ -509,6 +514,9 @@ export class Popover {
flex.remove();
this.post.progress.delete();

// re-enable .removeSpinner()
StackExchange.helpers.removeSpinner = old;

// don't show performed/failed action icons if post has been flagged
if (reportType !== 'NoFlag') return;

Expand Down

0 comments on commit e6ea22a

Please sign in to comment.