diff options
| author | Jenny Yu <jennyyu212@outlook.com> | 2022-06-12 22:45:23 -0700 |
|---|---|---|
| committer | Jenny Yu <jennyyu212@outlook.com> | 2022-06-12 22:45:23 -0700 |
| commit | 95d0f3f9b341020c742cf0df8402a564cc7c5dec (patch) | |
| tree | 9a6904e11f0618f849b792e50ac22bf6d6d444d1 /src/client/views/DashboardView.tsx | |
| parent | 04fd9f20ccdc204dad5724008b076cbf9ea7b874 (diff) | |
fix: filtering dashboards
Diffstat (limited to 'src/client/views/DashboardView.tsx')
| -rw-r--r-- | src/client/views/DashboardView.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx index efc1644fe..e48c1bde1 100644 --- a/src/client/views/DashboardView.tsx +++ b/src/client/views/DashboardView.tsx @@ -40,10 +40,13 @@ export class DashboardView extends React.Component { } getDashboards = () => { - const allDashbaords = DocListCast(CurrentUserUtils.MyDashboards.data); - // TODO: filter the dashboards - // return allDashbaords.filter(...) - return allDashbaords + const allDashboards = DocListCast(CurrentUserUtils.MyDashboards.data); + if (this.selectedDashboardGroup === DashboardGroup.MyDashboards) { + return allDashboards.filter((dashboard) => dashboard.author === Doc.CurrentUserEmail) + } else { + allDashboards.map(d => console.log(d.author)) + return allDashboards.filter((dashboard) => dashboard.author !== Doc.CurrentUserEmail) + } } render() { |
