diff options
author | crupest <crupest@outlook.com> | 2021-01-11 21:54:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-11 21:54:33 +0800 |
commit | 26f02d90c2571251b32c3b03b970dd290e3892e6 (patch) | |
tree | d635081fb6eaa0222270bfb4ac29906fb767a9bd /FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx | |
parent | ce08fc3865a117ee2b7f56d25fc96e80efc13587 (diff) | |
download | timeline-26f02d90c2571251b32c3b03b970dd290e3892e6.tar.gz timeline-26f02d90c2571251b32c3b03b970dd290e3892e6.tar.bz2 timeline-26f02d90c2571251b32c3b03b970dd290e3892e6.zip |
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx')
-rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx index f5dec67c..f8b2b38b 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx @@ -7,7 +7,6 @@ import { useUser } from "@/services/user"; import { timelineService, usePosts, useTimeline } from "@/services/timeline"; import { getHttpBookmarkClient } from "@/http/bookmark"; import { getHttpHighlightClient } from "@/http/highlight"; -import { getHttpUserClient, HttpUserNotExistError } from "@/http/user"; import { TimelineMemberDialog } from "./TimelineMember"; import TimelinePropertyChangeDialog from "./TimelinePropertyChangeDialog"; @@ -203,30 +202,8 @@ export default function TimelinePageTemplate<TManageItem>( <TimelineMemberDialog open onClose={closeDialog} - members={[timeline.owner, ...timeline.members]} - edit={ - service.hasManagePermission(user, timeline) - ? { - onCheckUser: (u) => { - return getHttpUserClient() - .get(u) - .catch((e) => { - if (e instanceof HttpUserNotExistError) { - return null; - } else { - throw e; - } - }); - }, - onAddUser: (u) => { - return service.addMember(name, u.username).toPromise().then(); - }, - onRemoveUser: (u) => { - service.removeMember(name, u); - }, - } - : null - } + timeline={timeline} + editable={service.hasManagePermission(user, timeline)} /> ); } |