aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/DashboardView.tsx9
-rw-r--r--src/client/views/MainView.tsx1
2 files changed, 2 insertions, 8 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index 35aa67ac8..6415601f1 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -53,14 +53,7 @@ export class DashboardView extends React.Component {
clickDashboard = async (e: React.MouseEvent, dashboard: Doc) => {
if (e.detail === 2) {
Doc.AddDocToList(Doc.MySharedDocs, 'viewed', dashboard);
- if (DocListCast(Doc.MySharedDocs.data).includes(dashboard)) {
- // choose an appropriate alias or make one. --- choose the first alias that (1) user owns, (2) has no context field ... otherwise make a new alias
- const bestAlias = DocListCast(dashboard.aliases).find(doc => doc.author === Doc.CurrentUserEmail);
- const nextBestAlias = DocListCast(dashboard.aliases).find(doc => doc.author === Doc.CurrentUserEmail);
- Doc.ActiveDashboard = bestAlias ?? nextBestAlias ?? Doc.MakeAlias(dashboard);
- } else {
- Doc.ActiveDashboard = dashboard;
- }
+ Doc.ActiveDashboard = dashboard;
Doc.ActivePage = 'dashboard';
}
};
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 4bf6bb881..c1cc80163 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -115,6 +115,7 @@ export class MainView extends React.Component {
}
@observable mainDoc: Opt<Doc>;
@computed private get mainContainer() {
+ if (Doc.ActiveDashboard) return Doc.ActiveDashboard;
if (window.location.pathname.startsWith('/doc/')) {
DocServer.GetRefField(window.location.pathname.substring('/doc/'.length)).then(main => runInAction(() => (this.mainDoc = main as Doc)));
return this.mainDoc;