diff --git a/pkg/interface/src/logic/state/graph.ts b/pkg/interface/src/logic/state/graph.ts index f46d972d4..4618186b3 100644 --- a/pkg/interface/src/logic/state/graph.ts +++ b/pkg/interface/src/logic/state/graph.ts @@ -64,7 +64,8 @@ const useGraphState = createState('Graph', (set, get) => ({ body['add-nodes'].resource.ship = body['add-nodes'].resource.ship.slice(1); GraphReducer({ 'graph-update': body, - 'graph-update-flat': body + 'graph-update-flat': body, + 'graph-update-thread': body }); await promise; }, @@ -74,7 +75,9 @@ const useGraphState = createState('Graph', (set, get) => ({ markPending(body['add-nodes'].nodes); body['add-nodes'].resource.ship = body['add-nodes'].resource.ship.slice(1); GraphReducer({ - 'graph-update': body + 'graph-update': body, + 'graph-update-flat': body, + 'graph-update-thread': body }); await promise; }, diff --git a/pkg/interface/src/views/landscape/components/Home/GroupFeed.tsx b/pkg/interface/src/views/landscape/components/Home/GroupFeed.tsx index 0c2fe320e..ea911d592 100644 --- a/pkg/interface/src/views/landscape/components/Home/GroupFeed.tsx +++ b/pkg/interface/src/views/landscape/components/Home/GroupFeed.tsx @@ -13,6 +13,7 @@ import { GroupFeedHeader } from './GroupFeedHeader'; import { PostRepliesRoutes } from './Post/PostReplies'; import PostTimeline from './Post/PostTimeline'; import airlock from '~/logic/api'; +import { PostThreadRoutes } from './Post/PostThread'; function GroupFeed(props) { const { @@ -87,6 +88,14 @@ function GroupFeed(props) { pendingSize={pendingSize} /> + + + s.addPost; + const PostInput = (props: PostInputProps): ReactElement | null => { const { graphPath, index, submitCallback } = props; const graphResource = resourceFromPath(graphPath); + const addPost = useGraphState(selGraph); const [disabled, setDisabled] = useState(false); const [code, toggleCode] = useToggleState(false); @@ -51,14 +55,14 @@ const PostInput = (props: PostInputProps): ReactElement | null => { setDisabled(true); const url = await promptUpload(); const { ship, name } = graphResource; - await airlock.thread(addPost(ship, name, createPost(`~${window.ship}`, [{ url }], index || ''))); + await addPost(ship, name, createPost(window.ship, [{ url }], index || '')); } catch (e) { // TODO: better handling console.error(e); } finally { setDisabled(false); } - }, [promptUpload]); + }, [promptUpload, addPost]); const sendPost = async () => { if (!graphResource) { @@ -74,13 +78,13 @@ const PostInput = (props: PostInputProps): ReactElement | null => { } setDisabled(true); - const post = createPost(`~${window.ship}`, contents, index || ''); + const post = createPost(window.ship, contents, index || ''); - await airlock.thread(addPost( + await addPost( graphResource.ship, graphResource.name, post - )); + ); setDisabled(false); if(code) { diff --git a/pkg/interface/src/views/landscape/components/Home/Post/PostItem/PostItem.tsx b/pkg/interface/src/views/landscape/components/Home/Post/PostItem/PostItem.tsx index c8ac4f970..65e4d5b8f 100644 --- a/pkg/interface/src/views/landscape/components/Home/Post/PostItem/PostItem.tsx +++ b/pkg/interface/src/views/landscape/components/Home/Post/PostItem/PostItem.tsx @@ -151,7 +151,7 @@ function PostItem(props: PostItemProps) { group={group} association={association} vip={vip} - index={index.join('/')} + index={`/${index.join('/')}`} submitCallback={toggleReplyMode} />