aboutsummaryrefslogtreecommitdiff
path: root/src/mobile/MobileMain.tsx
blob: 07839b6f67d5daa7ec44b80bb317fdb2279972ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { DocServer } from '../client/DocServer';
import { Docs } from '../client/documents/Documents';
import { CurrentUserUtils } from '../client/util/CurrentUserUtils';
import { AssignAllExtensions } from '../extensions/Extensions';
import { MobileInterface } from './MobileInterface';

AssignAllExtensions();

(async () => {
    const info = await CurrentUserUtils.loadCurrentUser();
    DocServer.init(window.location.protocol, window.location.hostname, 4321, info.email + ' (mobile)');
    await Docs.Prototypes.initialize();
    await CurrentUserUtils.loadUserDocument(info);
    document.getElementById('root')!.addEventListener(
        'wheel',
        event => {
            if (event.ctrlKey) {
                event.preventDefault();
            }
        },
        true
    );
    ReactDOM.render(<MobileInterface />, document.getElementById('root'));
})();