From 08533f4d1f24fa9fbd187a86bc1e83d9b2b45783 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 8 May 2024 00:10:54 +0300 Subject: [PATCH 1/4] debug-author-profile --- src/components/Views/Author/Author.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index 79140961..3d102df9 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -76,17 +76,24 @@ export const AuthorView = (props: Props) => { const fetchData = async (slug: string) => { try { - const [subscriptionsResult, followersResult, authorResult] = await Promise.all([ + const [followsResult, followersResult, authorResult] = await Promise.all([ apiClient.getAuthorFollows({ slug }), apiClient.getAuthorFollowers({ slug }), loadAuthor({ slug }), ]) - const { authors, topics } = subscriptionsResult + const { authors, topics, error } = followsResult + if (error) { + console.error(error) + return + } + console.debug(authorResult) setAuthor(authorResult) + console.debug(authors, topics) setFollowing([...(authors || []), ...(topics || [])]) + console.debug(followersResult) setFollowers(followersResult || []) - console.debug('[components.Author] following data loaded', subscriptionsResult) + console.debug('[components.Author] author follows:', followsResult) } catch (error) { console.error('[components.Author] fetch error', error) } From 605dae2127908d1c56851b5d68ee7f7b71fe9eab Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 8 May 2024 23:43:38 +0300 Subject: [PATCH 2/4] common-result --- src/graphql/client/core.ts | 2 +- src/graphql/query/core/author-follows.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphql/client/core.ts b/src/graphql/client/core.ts index 9c083e86..bab144f9 100644 --- a/src/graphql/client/core.ts +++ b/src/graphql/client/core.ts @@ -134,7 +134,7 @@ export const apiClient = { slug?: string author_id?: number user?: string - }): Promise => { + }): Promise => { const response = await publicGraphQLClient.query(authorFollows, params).toPromise() return response.data.get_author_follows }, diff --git a/src/graphql/query/core/author-follows.ts b/src/graphql/query/core/author-follows.ts index 9d46ea2c..31924246 100644 --- a/src/graphql/query/core/author-follows.ts +++ b/src/graphql/query/core/author-follows.ts @@ -3,6 +3,7 @@ import { gql } from '@urql/core' export default gql` query GetAuthorFollows($slug: String, $user: String, $author_id: Int) { get_author_follows(slug: $slug, user: $user, author_id: $author_id) { + error authors { id slug From 53d3e2d83635f8efd000eb431814f120f86d8d26 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 9 May 2024 18:08:54 +0300 Subject: [PATCH 3/4] nounswiped --- .../_shared/SolidSwiper/Swiper.module.scss | 12 ------------ src/graphql/client/core.ts | 1 - 2 files changed, 13 deletions(-) diff --git a/src/components/_shared/SolidSwiper/Swiper.module.scss b/src/components/_shared/SolidSwiper/Swiper.module.scss index 78d205e2..f66de2fc 100644 --- a/src/components/_shared/SolidSwiper/Swiper.module.scss +++ b/src/components/_shared/SolidSwiper/Swiper.module.scss @@ -8,18 +8,6 @@ } } -.unswiped { - width: 100%; - margin: 2rem 0; - margin-bottom: 6rem; - padding-bottom: 2rem; - display: block; - - h2 { - text-align: center; - } -} - .Swiper { display: block; margin: 2rem 0; diff --git a/src/graphql/client/core.ts b/src/graphql/client/core.ts index bab144f9..bbfa00f4 100644 --- a/src/graphql/client/core.ts +++ b/src/graphql/client/core.ts @@ -1,6 +1,5 @@ import type { Author, - AuthorFollowsResult, CommonResult, FollowingEntity, LoadShoutsOptions, From ab7dda6c1445a588d03402659389dc94716c8163 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 10 May 2024 15:44:36 +0300 Subject: [PATCH 4/4] safari-regexp-fix --- src/components/Views/PublishSettings/PublishSettings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Views/PublishSettings/PublishSettings.tsx b/src/components/Views/PublishSettings/PublishSettings.tsx index de86a02b..44289502 100644 --- a/src/components/Views/PublishSettings/PublishSettings.tsx +++ b/src/components/Views/PublishSettings/PublishSettings.tsx @@ -59,7 +59,7 @@ export const PublishSettings = (props: Props) => { const composeDescription = () => { if (!props.form.description) { - const cleanFootnotes = props.form.body.replaceAll(/.*?<\/footnote>/g, '') + const cleanFootnotes = props.form.body.replaceAll(/(.*?)<\/footnote>/g, '') const leadText = cleanFootnotes.replaceAll(/<\/?[^>]+(>|$)/gi, ' ') return shorten(leadText, DESCRIPTION_MAX_LENGTH).trim() }