Skip to content

Commit

Permalink
cci(csr): fix diff display on revdel'd revs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Nov 18, 2024
1 parent d787eeb commit b1dd0f4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ui/root/DeputyContributionSurveyRevision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,16 @@ export default class DeputyContributionSurveyRevision
let loaded = false;
const handleDiffToggle = ( active: boolean ) => {
this.diffToggle.setIndicator( active ? 'up' : 'down' );
if ( active && this.diff.classList.contains( 'dp-cs-rev-diff--errored' ) ) {
// Remake diff panel
if ( !active ) {
this.diff.classList.toggle( 'dp-cs-rev-diff--hidden', true );
return;
}

if ( this.diff.classList.contains( 'dp-cs-rev-diff--errored' ) ) {
// Error occurred previously, remake diff panel
this.diff = swapElements( this.diff, <div class="dp-cs-rev-diff"/> as HTMLElement );
} else if ( loaded ) {
this.diff.classList.toggle( 'dp-cs-rev-diff--hidden', !active );
this.diff.classList.toggle( 'dp-cs-rev-diff--hidden', false );
}

if ( active && !loaded ) {
Expand Down

0 comments on commit b1dd0f4

Please sign in to comment.