diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx
index c2414246..39285612 100644
--- a/src/components/Author/AuthorBadge/AuthorBadge.tsx
+++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx
@@ -17,9 +17,8 @@ type Props = {
export const AuthorBadge = (props: Props) => {
const [isSubscribing, setIsSubscribing] = createSignal(false)
const {
- isAuthenticated,
session,
- actions: { loadSession }
+ actions: { loadSession, requireAuthentication }
} = useSession()
const { t } = useLocalize()
@@ -37,6 +36,11 @@ export const AuthorBadge = (props: Props) => {
await loadSession()
setIsSubscribing(false)
}
+ const handleSubscribe = (really: boolean) => {
+ requireAuthentication(() => {
+ subscribe(really)
+ }, 'subscribe')
+ }
return (
@@ -51,10 +55,10 @@ export const AuthorBadge = (props: Props) => {
}
>
- {props.author.bio}
+
-
+
{
subscribe(!subscribed)}
+ onClick={() => handleSubscribe(!subscribed())}
/>
}
>
@@ -73,15 +77,15 @@ export const AuthorBadge = (props: Props) => {
variant="primary"
size="S"
value={isSubscribing() ? t('...subscribing') : t('Subscribe')}
- onClick={() => subscribe(true)}
+ onClick={() => handleSubscribe(true)}
/>
}
>
diff --git a/src/graphql/query/article-load.ts b/src/graphql/query/article-load.ts
index d16589ba..832c2931 100644
--- a/src/graphql/query/article-load.ts
+++ b/src/graphql/query/article-load.ts
@@ -32,6 +32,7 @@ export default gql`
name
slug
userpic
+ createdAt
}
createdAt
publishedAt
diff --git a/src/graphql/query/author-followers.ts b/src/graphql/query/author-followers.ts
index d300c385..07310309 100644
--- a/src/graphql/query/author-followers.ts
+++ b/src/graphql/query/author-followers.ts
@@ -8,6 +8,7 @@ export default gql`
name
userpic
bio
+ createdAt
stat {
shouts
}
diff --git a/src/graphql/query/author-following-users.ts b/src/graphql/query/author-following-users.ts
index c62de1eb..4d36d61c 100644
--- a/src/graphql/query/author-following-users.ts
+++ b/src/graphql/query/author-following-users.ts
@@ -8,6 +8,7 @@ export default gql`
name
userpic
bio
+ createdAt
stat {
shouts
}
diff --git a/src/graphql/query/authors-all.ts b/src/graphql/query/authors-all.ts
index 06e9ad75..dc5baa5e 100644
--- a/src/graphql/query/authors-all.ts
+++ b/src/graphql/query/authors-all.ts
@@ -8,6 +8,7 @@ export default gql`
name
bio
userpic
+ createdAt
stat {
shouts
followers
diff --git a/src/graphql/query/authors-load-by.ts b/src/graphql/query/authors-load-by.ts
index 97cd436d..0792cae9 100644
--- a/src/graphql/query/authors-load-by.ts
+++ b/src/graphql/query/authors-load-by.ts
@@ -10,7 +10,7 @@ export default gql`
userpic
# communities
links
- # createdAt
+ createdAt
lastSeen
# ratings {
# rater
diff --git a/src/graphql/query/drafts-load.ts b/src/graphql/query/drafts-load.ts
index e6bb68c6..73c3e5ef 100644
--- a/src/graphql/query/drafts-load.ts
+++ b/src/graphql/query/drafts-load.ts
@@ -28,6 +28,7 @@ export default gql`
name
slug
userpic
+ createdAt
}
createdAt
publishedAt
diff --git a/src/graphql/query/my-feed.ts b/src/graphql/query/my-feed.ts
index a4b0f3b8..0d09c299 100644
--- a/src/graphql/query/my-feed.ts
+++ b/src/graphql/query/my-feed.ts
@@ -22,6 +22,7 @@ export default gql`
name
slug
userpic
+ createdAt
}
createdAt
publishedAt
diff --git a/src/graphql/query/reactions-load-by.ts b/src/graphql/query/reactions-load-by.ts
index 421c651c..ca1d31c8 100644
--- a/src/graphql/query/reactions-load-by.ts
+++ b/src/graphql/query/reactions-load-by.ts
@@ -17,6 +17,7 @@ export default gql`
name
slug
userpic
+ createdAt
}
createdAt
updatedAt