Skip to content

Commit

Permalink
fix fatal error outside of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Oct 20, 2024
1 parent 04d85af commit a92b5ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
afchPage, afchSubmission, afchViews, afchViewer;

// Die if reviewing a nonexistent page or a userjs/css page
if ( !inUnitTestEnvironment ) {
if ( typeof inUnitTestEnvironment === 'undefined' ) {
if ( mw.config.get( 'wgArticleId' ) === 0 ||
mw.config.get( 'wgPageContentModel' ) !== 'wikitext' ) {
return;
Expand Down Expand Up @@ -752,7 +752,7 @@
}
};

if ( !inUnitTestEnvironment ) {
if ( typeof inUnitTestEnvironment === 'undefined' ) {
// Add the launch link
$afchLaunchLink = $( mw.util.addPortletLink( AFCH.prefs.launchLinkPosition, '#', 'Review (AFCH)',
'afch-launch', 'Review submission using afc-helper', '1' ) );
Expand Down

0 comments on commit a92b5ae

Please sign in to comment.