aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Main.tsx
diff options
context:
space:
mode:
authorMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
committerMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
commit7683e1fbb53fe683c0d04e537d89fb53d768e852 (patch)
treed81eebcd5a129550a49fdfc852b8bb6220907a1a /src/client/views/Main.tsx
parentf4382d73eec75f7d7f4bfe6eae3fb1efa128a021 (diff)
parentaff9cc02750eb032ade98d77cf9ff45677063fc8 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into webcam_mohammad
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r--src/client/views/Main.tsx24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index a91a2b69e..b21eb9c8f 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -3,34 +3,11 @@ import { Docs } from "../documents/Documents";
import { CurrentUserUtils } from "../../server/authentication/models/current_user_utils";
import * as ReactDOM from 'react-dom';
import * as React from 'react';
-import { Cast } from "../../new_fields/Types";
-import { Doc, DocListCastAsync } from "../../new_fields/Doc";
-import { List } from "../../new_fields/List";
import { DocServer } from "../DocServer";
import { AssignAllExtensions } from "../../extensions/General/Extensions";
AssignAllExtensions();
-let swapDocs = async () => {
- let oldDoc = await Cast(CurrentUserUtils.UserDocument.linkManagerDoc, Doc);
- // Docs.Prototypes.MainLinkDocument().allLinks = new List<Doc>();
- if (oldDoc) {
- let links = await DocListCastAsync(oldDoc.allLinks);
- // if (links && DocListCast(links)) {
- if (links && links.length) {
- let data = await DocListCastAsync(Docs.Prototypes.MainLinkDocument().allLinks);
- if (data) {
- data.push(...links.filter(i => data!.indexOf(i) === -1));
- Docs.Prototypes.MainLinkDocument().allLinks = new List<Doc>(data.filter((i, idx) => data!.indexOf(i) === idx));
- }
- else {
- Docs.Prototypes.MainLinkDocument().allLinks = new List<Doc>(links);
- }
- }
- CurrentUserUtils.UserDocument.linkManagerDoc = undefined;
- }
-};
-
(async () => {
const info = await CurrentUserUtils.loadCurrentUser();
DocServer.init(window.location.protocol, window.location.hostname, 4321, info.email);
@@ -38,7 +15,6 @@ let swapDocs = async () => {
if (info.id !== "__guest__") {
// a guest will not have an id registered
await CurrentUserUtils.loadUserDocument(info);
- await swapDocs();
}
document.getElementById('root')!.addEventListener('wheel', event => {
if (event.ctrlKey) {