diff --git a/src/components/change-view.jsx b/src/components/change-view.jsx index 0c4453a5..a8b160cc 100644 --- a/src/components/change-view.jsx +++ b/src/components/change-view.jsx @@ -8,6 +8,13 @@ import SelectDiffType from './select-diff-type'; import SelectVersion from './select-version'; import Loading from './loading'; import VersionistaInfo from './versionista-info'; +import {diffTypesFor} from '../constants/diff-types'; +import { + htmlType, + mediaTypeForExtension, + parseMediaType, + unknownType +} from '../scripts/media-type'; const collapsedViewStorage = 'WebMonitoring.ChangeView.collapsedView'; @@ -46,6 +53,10 @@ export default class ChangeView extends React.Component { const page = this.props.page; if (page.versions && page.versions.length > 1) { this.state.diffType = 'SIDE_BY_SIDE_RENDERED'; + const relevantTypes = relevantDiffTypes(this.props.from, this.props.to); + if (!relevantTypes.find(type => type.value === this.state.diffType)) { + this.state.diffType = relevantTypes[0].value; + } } if ('sessionStorage' in window) { @@ -130,7 +141,11 @@ export default class ChangeView extends React.Component {