<commit_before>define(['src/Header', 'src/Toolbar', 'src/Content', 'src/Constants'], (Header, Toolbar, Content, Constants) => {
    'use strict';
    const mobileViewCondition = window.matchMedia('(max-width:800px)');
    /*
     * Kasailee kalenterin eri osat paikalleen <Calendar.currentView> -muodossa.
     */
    class Layout extends Inferno.Component {
        /**
         * @param {object} props {
         *     dateCursor: {DateCursor},
         *     currentView: {string},
         *     titleFormatters: {Object}
         *     changeView: {Function}
         * }
         */
        constructor(props) {
            super(props);
            this.state = {
                isMobileViewEnabled: mobileViewCondition.matches
            };
        }
        /**
         * Lisää matchmedia-kuuntelijan.
         */
        componentWillMount() {
            mobileViewCondition.addListener(this.viewPortListener.bind(this));
        }
        /**
         * Matchmedia-kuuntelija. Päivittää state.isMobileViewEnabled:n arvoksi
         * true, mikäli selaimen ikkuna on pienempi kuin <n>, tai false, jos se
         * on suurempi kuin <n>.
         *
         * @access private
         * @param {MediaQueryList} newMatch
         */
        viewPortListener(newMatch) {
            // Päivänäkymällä ei ole erillistä mobile™-mutaatiota
            if (this.props.currentView === Constants.VIEW_DAY) {
                return;
            }
            const newIsMobileViewEnabled = newMatch.matches;
            if (newIsMobileViewEnabled !== this.state.isMobileViewEnabled) {
                this.setState({isMobileViewEnabled: newIsMobileViewEnabled});
            }
        }
        /**<commit_msg>Korjaa bugi, jossa näkymä ei vaihtunut desktop -> mobile mutaatioon oike- alla tavalla.<commit_after>define(['src/Header', 'src/Toolbar', 'src/Content', 'src/Constants'], (Header, Toolbar, Content, Constants) => {
    'use strict';
    const mobileViewCondition = window.matchMedia('(max-width:800px)');
    /*
     * Kasailee kalenterin eri osat paikalleen <Calendar.currentView> -muodossa.
     */
    class Layout extends Inferno.Component {
        /**
         * @param {object} props {
         *     dateCursor: {DateCursor},
         *     currentView: {string},
         *     titleFormatters: {Object}
         *     changeView: {Function}
         * }
         */
        constructor(props) {
            super(props);
            this.state = {
                isMobileViewEnabled: mobileViewCondition.matches
            };
        }
        /**
         * Lisää matchmedia-kuuntelijan.
         */
        componentWillMount() {
            mobileViewCondition.addListener(this.viewPortListener.bind(this));
        }
        /**
         * Matchmedia-kuuntelija. Päivittää state.isMobileViewEnabled:n arvoksi
         * true, mikäli selaimen ikkuna on pienempi kuin <n>, tai false, jos se
         * on suurempi kuin <n>.
         *
         * @access private
         * @param {MediaQueryList} newMatch
         */
        viewPortListener(newMatch) {
            const newIsMobileViewEnabled = newMatch.matches;
            if (newIsMobileViewEnabled !== this.state.isMobileViewEnabled) {
                this.setState({isMobileViewEnabled: newIsMobileViewEnabled});
            }
        }
        /**
{'fraction_non_alphanumeric': 0.10981098109810981, 'fraction_numerical': 0.0018001800180018, 'mean_word_length': 1.881590319792567, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7097831', 'n_tokens_mistral': 975, 'n_tokens_neox': 947, 'n_words': 176}