Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Oct 21, 2023
1 parent 5395cf5 commit 6695498
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/modules/ccrf/ui/checks/DeletedRevisionCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class DeletedRevisionCheck
if ( closestInterval !== lastInterval ) {
revisionElements.push(
<div class="ccrf-deleted-revision--interval">
{window.moment( now - revisionTimestamp ).fromNow()}
{window.moment( revisionTimestamp ).fromNow()}
</div>
);
lastInterval = closestInterval;
Expand Down
9 changes: 9 additions & 0 deletions src/modules/ccrf/ui/pages/CRFDUserCheckPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ function initCRFDUserCheckPageLayout() {

const checkPromises = [];
const checks = this.dialog.getEnabledChecks();

if ( Object.values( checks ).every( v => !v ) ) {
// No checks enabled!
// Do nothing (manual check interface should already
// be shown).
return;
}

if ( checks.page ) {
checkPromises.push(
DispatchUser.i.deletedPages( this.user )
Expand Down Expand Up @@ -185,6 +193,7 @@ function initCRFDUserCheckPageLayout() {

return [
<p>{mw.msg( 'deputy.ccrf.step2.details' )}</p>,
<hr />,
checkList,
unwrapJQ( <p/>, mw.message( 'deputy.ccrf.step2.details2' ).parseDom() ),
( this.mainContainer ?? ( this.mainContainer = this.renderNoUserMessageBox() ) )
Expand Down
9 changes: 6 additions & 3 deletions src/ui/shared/ChangesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export function ChangesListLinks(
getRevisionDiffURL( _parentid, _revid );

let cv;
if ( window.deputy.config.cci.showCvLink && window.deputy.wikiConfig.cci.earwigRoot ) {
if (
window.deputy &&
window.deputy.config.cci.showCvLink &&
window.deputy.wikiConfig.cci.earwigRoot
) {
cv = new URL( '', window.deputy.wikiConfig.cci.earwigRoot.get() );
const selfUrl = new URL( window.location.href );
const urlSplit = selfUrl.hostname.split( '.' ).reverse();
Expand Down Expand Up @@ -61,7 +65,6 @@ export function ChangesListLinks(
>{ mw.msg( 'deputy.revision.prev' ) }</a>
}</span>
{
!!window.deputy.config.cci.showCvLink &&
cv &&
<span>
<a
Expand Down Expand Up @@ -126,7 +129,7 @@ export function ChangesListDate(
const formattedTime = time.toLocaleTimeString( USER_LOCALE, {
hourCycle: 'h24',
timeStyle: mw.user.options.get( 'date' ) === 'ISO 8601' ? 'long' : 'short',
timeZone: window.deputy.config.cci.forceUtc.get() ? 'UTC' : undefined
timeZone: window.deputy?.config.cci.forceUtc.get() ? 'UTC' : undefined
} );
const formattedDate = now.locale( USER_LOCALE ).format( {
dmy: 'D MMMM YYYY',
Expand Down

0 comments on commit 6695498

Please sign in to comment.