aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-21 15:11:19 -0400
committerbobzel <zzzman@gmail.com>2022-06-21 15:11:19 -0400
commitd446a2c555019133f549978eb3a8453ac40c28d9 (patch)
tree044013c32d6175d39307934e02eebf28fec828b4 /src/client/views/MainView.tsx
parentc0bdb958920f1f0f68a35c70d5b4ad1bf5ea5824 (diff)
parent5c582ee52f3af9515d3397fa7661d068fe1babe8 (diff)
Merge branch 'master' into temporalmedia-mehek
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 61cca0421..6ee8065f5 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -225,26 +225,21 @@ export class MainView extends React.Component {
// Load the user's active dashboard, or create a new one if initial session after signup
const received = CurrentUserUtils.MainDocId;
if (received && !this.userDoc) {
- reaction(() => CurrentUserUtils.GuestTarget, target => target && CurrentUserUtils.createNewDashboard(Doc.UserDoc()), { fireImmediately: true });
+ reaction(() => CurrentUserUtils.GuestTarget, target => target && CurrentUserUtils.createNewDashboard(), { fireImmediately: true });
} else {
PromiseValue(this.userDoc.activeDashboard).then(dash => {
- if (dash instanceof Doc) CurrentUserUtils.openDashboard(this.userDoc, dash);
- else CurrentUserUtils.createNewDashboard(this.userDoc);
+ if (dash instanceof Doc) CurrentUserUtils.openDashboard(dash);
+ else CurrentUserUtils.createNewDashboard();
});
}
}
@action
createNewPresentation = async () => {
- if (!await this.userDoc.myTrails) {
- this.userDoc.myTrails = new PrefetchProxy(Docs.Create.TreeDocument([], {
- title: "TRAILS", childDontRegisterViews: true, _height: 100, _forceActive: true, boxShadow: "0 0", _lockedPosition: true, treeViewOpen: true, system: true
- }));
- }
const pres = Docs.Create.PresDocument({ title: "Untitled Trail", _viewType: CollectionViewType.Stacking, _fitWidth: true, _width: 400, _height: 500, targetDropAction: "alias", _chromeHidden: true, boxShadow: "0 0" });
CollectionDockingView.AddSplit(pres, "left");
- this.userDoc.activePresentation = pres;
- Doc.AddDocToList(this.userDoc.myTrails as Doc, "data", pres);
+ CurrentUserUtils.ActivePresentation = pres;
+ Doc.AddDocToList(CurrentUserUtils.MyTrails, "data", pres);
}
@action
@@ -353,9 +348,9 @@ export class MainView extends React.Component {
addDocTabFunc = (doc: Doc, location: string): boolean => {
const locationFields = doc._viewType === CollectionViewType.Docking ? ["dashboard"] : location.split(":");
const locationParams = locationFields.length > 1 ? locationFields[1] : "";
- if (doc.dockingConfig) return CurrentUserUtils.openDashboard(Doc.UserDoc(), doc);
+ if (doc.dockingConfig) return CurrentUserUtils.openDashboard(doc);
switch (locationFields[0]) {
- case "dashboard": return CurrentUserUtils.openDashboard(Doc.UserDoc(), doc);
+ case "dashboard": return CurrentUserUtils.openDashboard(doc);
case "close": return CollectionDockingView.CloseSplit(doc, locationParams);
case "fullScreen": return CollectionDockingView.OpenFullScreen(doc);
case "lightbox": return LightboxView.AddDocTab(doc, location);
@@ -563,7 +558,7 @@ export class MainView extends React.Component {
</div>;
}
@computed get snapLines() {
- return !this.userDoc.showSnapLines ? (null) : <div className="mainView-snapLines">
+ return !SnappingManager.GetShowSnapLines() ? (null) : <div className="mainView-snapLines">
<svg style={{ width: "100%", height: "100%" }}>
{SnappingManager.horizSnapLines().map(l => <line x1="0" y1={l} x2="2000" y2={l} stroke="black" opacity={0.3} strokeWidth={0.5} strokeDasharray={"1 1"} />)}
{SnappingManager.vertSnapLines().map(l => <line y1="0" x1={l} y2="2000" x2={l} stroke="black" opacity={0.3} strokeWidth={0.5} strokeDasharray={"1 1"} />)}