代码拉取完成,页面将自动刷新
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import './entry.js';
import React from 'react';
import ReactDOM from 'react-dom';
import {logError} from 'mattermost-redux/actions/errors';
import PDFJS from 'pdfjs-dist';
// Import our styles
import 'sass/styles.scss';
import 'katex/dist/katex.min.css';
import {isDevMode, setCSRFFromCookie} from 'utils/utils';
import store from 'stores/redux_store.jsx';
import App from 'components/app';
PDFJS.disableWorker = true;
// This is for anything that needs to be done for ALL react components.
// This runs before we start to render anything.
function preRenderSetup(callwhendone) {
window.onerror = (msg, url, line, column, stack) => {
if (msg === 'ResizeObserver loop limit exceeded') {
return;
}
var l = {};
l.level = 'ERROR';
l.message = 'msg: ' + msg + ' row: ' + line + ' col: ' + column + ' stack: ' + stack + ' url: ' + url;
const req = new XMLHttpRequest();
req.open('POST', '/api/v4/logs');
req.setRequestHeader('Content-Type', 'application/json');
req.send(JSON.stringify(l));
if (isDevMode()) {
store.dispatch(logError({type: 'developer', message: 'DEVELOPER MODE: A JavaScript error has occurred. Please use the JavaScript console to capture and report the error (row: ' + line + ' col: ' + column + ').'}, true));
}
};
setCSRFFromCookie();
callwhendone();
}
function renderRootComponent() {
ReactDOM.render((
<App/>
),
document.getElementById('root'));
}
/**
* Adds a function to be invoked onload appended to any existing onload
* event handlers.
*
* @param {function} fn onload event handler
*
*/
function appendOnLoadEvent(fn) {
if (window.attachEvent) {
window.attachEvent('onload', fn);
} else if (window.onload) {
const curronload = window.onload;
window.onload = (evt) => {
curronload(evt);
fn(evt);
};
} else {
window.onload = fn;
}
}
appendOnLoadEvent(() => {
// Do the pre-render setup and call renderRootComponent when done
preRenderSetup(renderRootComponent);
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。