aboutsummaryrefslogtreecommitdiff
path: root/src/mobile/MobileMain.tsx
blob: 34f06438f7bd18a8380382e9f7e4e2ed62b3c4e9 (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
import { DocServer } from '../client/DocServer';
import { Docs } from '../client/documents/Documents';
import * as ReactDOM from "react-dom";
import { MobileInterface } from './MobileInterface';
import * as React from "react";
import { AssignAllExtensions } from '../extensions/General/Extensions';
import { CurrentUserUtils } from '../client/util/CurrentUserUtils';

AssignAllExtensions();

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