<commit_before>import React, { useEffect } from 'react';
import { inject } from 'mobx-react';
import { f7 } from 'framework7-react';
import { useTranslation } from 'react-i18next';

const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocument}) => {
    const {t} = useTranslation();
    const _t = t("Error", { returnObjects: true });

    useEffect(() => {
        Common.Notifications.on('engineCreated', (api) => {
            api.asc_registerCallback('asc_onError', onError);
        });
        return () => {
            const api = Common.EditorApi.get();
            api.asc_unregisterCallback('asc_onError', onError);
        }
    });

    const onError = (id, level, errData) => {
        if (id === -82) return; // format error

        if (id === Asc.c_oAscError.ID.LoadingScriptError) {
            f7.notification.create({
                title: _t.criticalErrorTitle,
                text: _t.scriptLoadError,
                closeButton: true
            }).open();
            return;
        }

        Common.Notifications.trigger('preloader:close');
        Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);

        const api = Common.EditorApi.get();

        const config = {
            closable: false
        };

        switch (id)
        {<commit_msg>[PE mobile] Removed ignore format error<commit_after>import React, { useEffect } from 'react';
import { inject } from 'mobx-react';
import { f7 } from 'framework7-react';
import { useTranslation } from 'react-i18next';

const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocument}) => {
    const {t} = useTranslation();
    const _t = t("Error", { returnObjects: true });

    useEffect(() => {
        Common.Notifications.on('engineCreated', (api) => {
            api.asc_registerCallback('asc_onError', onError);
        });
        return () => {
            const api = Common.EditorApi.get();
            api.asc_unregisterCallback('asc_onError', onError);
        }
    });

    const onError = (id, level, errData) => {
        if (id === Asc.c_oAscError.ID.LoadingScriptError) {
            f7.notification.create({
                title: _t.criticalErrorTitle,
                text: _t.scriptLoadError,
                closeButton: true
            }).open();
            return;
        }

        Common.Notifications.trigger('preloader:close');
        Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);

        const api = Common.EditorApi.get();

        const config = {
            closable: false
        };

        switch (id)
        {
{'fraction_non_alphanumeric': 0.13551230260741828, 'fraction_numerical': 0.0044069041498347415, 'mean_word_length': 2.354679802955665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4551383', 'n_tokens_mistral': 775, 'n_tokens_neox': 747, 'n_words': 151}