diff --git a/packages/ui/src/lib/adapters/firebase/index.ts b/packages/ui/src/lib/adapters/firebase/index.ts index 0f191c5..941d897 100644 --- a/packages/ui/src/lib/adapters/firebase/index.ts +++ b/packages/ui/src/lib/adapters/firebase/index.ts @@ -281,7 +281,7 @@ export class Firebase implements Adapter { text: string, images: string[], signer: Signer, - ): Promise { + ): Promise { const address = await signer.getAddress() const isMemberOfGroup = get(personas).all.get(groupId)?.participants?.includes(address) @@ -304,7 +304,7 @@ export class Firebase implements Adapter { // Store post to pending const pendingPosts = collection(db, `personas/${groupId}/pending`) - addDoc(pendingPosts, post) + const postDoc = await addDoc(pendingPosts, post) const profileCollection = collection(db, `users/${address}/transactions`) await addDoc(profileCollection, { @@ -322,6 +322,8 @@ export class Firebase implements Adapter { { address, go: go - NEW_POST_GO_PRICE, repTotal, repStaked: repStaked + NEW_POST_REP_PRICE }, { merge: true }, ) + + return postDoc.id } async subscribePersonaPosts(groupId: string): Promise<() => unknown> { diff --git a/packages/ui/src/lib/adapters/in-memory-and-ipfs/index.ts b/packages/ui/src/lib/adapters/in-memory-and-ipfs/index.ts index b704571..34152ff 100644 --- a/packages/ui/src/lib/adapters/in-memory-and-ipfs/index.ts +++ b/packages/ui/src/lib/adapters/in-memory-and-ipfs/index.ts @@ -404,7 +404,7 @@ export class InMemoryAndIPFS implements Adapter { text: string, images: string[], signer: Signer, - ): Promise { + ): Promise { await signer.signMessage('This "transaction" publishes a post to pending') const post = { @@ -430,6 +430,8 @@ export class InMemoryAndIPFS implements Adapter { }) return { transactions } }) + + return post.postId } async subscribePersonaPosts(groupId: string): Promise<() => unknown> { diff --git a/packages/ui/src/lib/adapters/index.ts b/packages/ui/src/lib/adapters/index.ts index e658784..3285f42 100644 --- a/packages/ui/src/lib/adapters/index.ts +++ b/packages/ui/src/lib/adapters/index.ts @@ -26,7 +26,7 @@ export interface Adapter { uploadPicture(picture: string): Promise getPicture(cid: string): string - publishPost(groupId: string, text: string, images: string[], signer: Signer): Promise + publishPost(groupId: string, text: string, images: string[], signer: Signer): Promise subscribePersonaPosts(groupId: string): Promise<() => unknown> voteOnPost(groupId: string, postId: string, vote: '+' | '-', signer: Signer): Promise diff --git a/packages/ui/src/lib/adapters/zkitter/index.ts b/packages/ui/src/lib/adapters/zkitter/index.ts index c128f47..340601d 100644 --- a/packages/ui/src/lib/adapters/zkitter/index.ts +++ b/packages/ui/src/lib/adapters/zkitter/index.ts @@ -332,7 +332,7 @@ export class ZkitterAdapter implements Adapter { text: string, images: string[], signer: Signer, - ): Promise { + ): Promise { // FIXME: properly implement console.error('NOT IMPLEMENTED', 'publishPost', signer) @@ -344,6 +344,8 @@ export class ZkitterAdapter implements Adapter { } posts.addPending(post, groupId) + + return post.postId } async subscribePersonaPosts(groupId: string): Promise<() => unknown> { diff --git a/packages/ui/src/routes/persona/[id]/pending/+page.svelte b/packages/ui/src/routes/persona/[id]/pending/+page.svelte index 4113c24..6797cdf 100644 --- a/packages/ui/src/routes/persona/[id]/pending/+page.svelte +++ b/packages/ui/src/routes/persona/[id]/pending/+page.svelte @@ -153,7 +153,7 @@ No GO left in this cycle {/if}
0 ? 'scrolled' : ''}`}> -
history.back()}> +
goto(ROUTES.PERSONA(groupId))}> {#if $profile.signer !== undefined}

Your post is now pending review

- Your post has been added to "Persona name's" pending list for community review. If it gets - promoted it will be automatically published to "Persona name's" page when the new epoch + Your post has been added to "{persona.name}'s" pending list for community review. If it gets + promoted it will be automatically published to "{persona.name}'s" page when the new epoch begins.

-