From 4b2b701cea24d4279af5f86459a4ff9693f8da68 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Fri, 9 Jun 2023 23:50:36 +0200 Subject: [PATCH] Fix #741 --- fastlane/metadata/en-US/release_notes.txt | 1 - fastlane/metadata/zh-Hans/release_notes.txt | 2 +- package.json | 2 +- src/components/Timeline/Shared/Card/Neodb.tsx | 46 +++++++++++++++---- 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/fastlane/metadata/en-US/release_notes.txt b/fastlane/metadata/en-US/release_notes.txt index 31978807..862623d2 100644 --- a/fastlane/metadata/en-US/release_notes.txt +++ b/fastlane/metadata/en-US/release_notes.txt @@ -1,2 +1 @@ Enjoy toooting! This version includes following improvements and fixes: -- Fixed functionality version check (e.g. cannot edit own toots) \ No newline at end of file diff --git a/fastlane/metadata/zh-Hans/release_notes.txt b/fastlane/metadata/zh-Hans/release_notes.txt index 6c872da7..53b6c0aa 100644 --- a/fastlane/metadata/zh-Hans/release_notes.txt +++ b/fastlane/metadata/zh-Hans/release_notes.txt @@ -1,2 +1,2 @@ tooot-ing愉快!此版本包括以下改进和修复: -- 修复版本功能检查(如无法编辑嘟文) \ No newline at end of file +- 新增neodb.social演出卡片 \ No newline at end of file diff --git a/package.json b/package.json index acabe8f5..432e63fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tooot", - "version": "4.9.6", + "version": "4.9.7", "description": "tooot for Mastodon", "author": "xmflsct ", "license": "GPL-3.0-or-later", diff --git a/src/components/Timeline/Shared/Card/Neodb.tsx b/src/components/Timeline/Shared/Card/Neodb.tsx index 2e02f28a..42229b3e 100644 --- a/src/components/Timeline/Shared/Card/Neodb.tsx +++ b/src/components/Timeline/Shared/Card/Neodb.tsx @@ -16,18 +16,19 @@ export type Props = { export const CardNeodb: React.FC = ({ card }) => { const { colors } = useTheme() - const segments = Linking.parse(card.url).path?.split('/') - if (!segments || !['movie', 'book', 'tv', 'game', 'album', 'podcast'].includes(segments[0])) + const path = Linking.parse(card.url).path + if (!path) return null + + const segments = path?.split('/') + if ( + !segments || + !['movie', 'book', 'tv', 'game', 'album', 'podcast', 'performance'].includes(segments[0]) + ) return null const [headingLines, setHeadingLines] = useState(3) - const { data } = useNeodbQuery({ - path: - segments[0] === 'tv' && segments[1] === 'season' - ? `${segments[0]}${segments[1]}/${segments[2]}` - : `${segments[0]}/${segments[1]}` - }) + const { data } = useNeodbQuery({ path }) if (!data) return null @@ -44,7 +45,13 @@ export const CardNeodb: React.FC = ({ card }) => { > {data.cover_image_url ? ( = ({ card }) => { return ( ) + case 'performance': + if (segments[1] === 'production') { + return ( + + ) + } else { + return ( + + ) + } default: return null }