Skip to content

Commit

Permalink
make ChangesList compatible with standalones
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed May 28, 2024
1 parent f1c04a5 commit 198e33a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ui/shared/ChangesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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 @@ -117,7 +121,7 @@ export function ChangesListDate(
const formattedTime = time.toLocaleTimeString( window.deputyLang, {
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( window.deputyLang ).format( {
dmy: 'D MMMM YYYY',
Expand Down

0 comments on commit 198e33a

Please sign in to comment.