diff --git a/Gemfile.lock b/Gemfile.lock index b96b6519..d11b8c6b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,8 +15,8 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.1) - aws-partitions (1.436.0) - aws-sdk-core (3.113.0) + aws-partitions (1.445.0) + aws-sdk-core (3.114.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) @@ -24,7 +24,7 @@ GEM aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.93.0) + aws-sdk-s3 (1.93.1) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) @@ -74,8 +74,8 @@ GEM commander-fastlane (4.4.6) highline (~> 1.7.2) concurrent-ruby (1.1.8) + connection_pool (2.2.5) declarative (0.0.20) - declarative-option (0.1.0) digest-crc (0.6.3) rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) @@ -85,19 +85,25 @@ GEM escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - excon (0.79.0) - faraday (1.3.0) + excon (0.80.1) + faraday (1.4.0) + faraday-excon (~> 1.0) faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) multipart-post (>= 1.2, < 3) - ruby2_keywords + ruby2_keywords (>= 0.0.4) faraday-cookie_jar (0.0.7) faraday (>= 0.8.0) http-cookie (~> 1.0.0) + faraday-excon (1.0.0) + excon (>= 0.27.4) faraday-net_http (1.0.1) + faraday-net_http_persistent (1.0.3) + net-http-persistent (>= 3.1) faraday_middleware (1.0.0) faraday (~> 1.0) fastimage (2.2.3) - fastlane (2.179.0) + fastlane (2.180.1) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) artifactory (~> 3.0) @@ -161,7 +167,7 @@ GEM rexml signet (~> 0.14) webrick - google-apis-iamcredentials_v1 (0.2.0) + google-apis-iamcredentials_v1 (0.3.0) google-apis-core (~> 0.1) google-apis-storage_v1 (0.3.0) google-apis-core (~> 0.1) @@ -179,7 +185,7 @@ GEM google-cloud-core (~> 1.2) googleauth (~> 0.9) mini_mime (~> 1.0) - googleauth (0.16.0) + googleauth (0.16.1) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -197,7 +203,7 @@ GEM jwt (2.2.2) memoist (0.16.2) mini_magick (4.11.0) - mini_mime (1.0.3) + mini_mime (1.1.0) minitest (5.14.4) molinillo (0.6.6) multi_json (1.15.0) @@ -205,17 +211,19 @@ GEM nanaimo (0.3.0) nap (1.1.0) naturally (2.2.1) + net-http-persistent (4.0.1) + connection_pool (~> 2.2) netrc (0.11.0) os (1.1.1) plist (3.6.0) public_suffix (4.0.6) rake (13.0.3) - representable (3.0.4) + representable (3.1.1) declarative (< 0.1.0) - declarative-option (< 0.2.0) + trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.4) + rexml (3.2.5) rouge (2.0.7) ruby-macho (1.4.0) ruby2_keywords (0.0.4) @@ -234,6 +242,7 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) + trailblazer-option (0.1.1) tty-cursor (0.7.1) tty-screen (0.8.1) tty-spinner (0.9.3) diff --git a/VERSIONING.md b/VERSIONING.md index 389dcb44..c9d788ad 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -21,10 +21,11 @@ ## OTA release channels - * `MAJOR-environment`. Environments include `production`, `staging` and `development`. + * `MAJOR-environment`. Environments include `release`, `candidate` and `development`. ## Major versions mapping to native module versions -| Major version | Native module version | -| :-----------: | :-------------------: | -| `0` | `210201` | \ No newline at end of file +| Major version | Native module version | Expo version | +| :-----------: | :-------------------: | :----------: | +| `0` | `210201` | `40.0.0` | +| `1` | `210317` | `40.0.0` | \ No newline at end of file diff --git a/fastlane/Deliverfile b/fastlane/Deliverfile index 5723e610..079a7135 100644 --- a/fastlane/Deliverfile +++ b/fastlane/Deliverfile @@ -1,4 +1,4 @@ -languages(['zh-Hans']) +languages(['zh-Hans', 'en-US']) name({ 'default' => "tooot" @@ -12,6 +12,11 @@ privacy_url({ support_url({ 'default' => "https://tooot.app" }) - copyright("#{Time.now.year} ©️ xmflsct") -primary_category("SOCIAL_NETWORKING") \ No newline at end of file +primary_category("SOCIAL_NETWORKING") + +automatic_release(false) +force(true) +precheck_include_in_app_purchases(false) +submit_for_review(true) +overwrite_screenshots(true) \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 60f68451..a2a11877 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,4 +1,4 @@ -fastlane_version "2.179.0" +fastlane_version "2.180.1" skip_docs ensure_env_vars( @@ -106,12 +106,7 @@ private_lane :build_ios do output_directory: BUILD_DIRECTORY, silent: true ) - upload_to_app_store( - force: true, - ipa: IPA_FILE, - submit_for_review: true, - automatic_release: false - ) + upload_to_app_store( ipa: IPA_FILE, app_version: VERSION ) else if !is_ci match( type: "development", readonly: true ) diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index e4a7160c..041b6785 120000 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1 +1 @@ -../../default/description.txt \ No newline at end of file +../../en-US/description.txt \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/0_65.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/0_65.png index 8f9c61cf..0b1a9446 120000 --- a/fastlane/metadata/android/en-US/images/phoneScreenshots/0_65.png +++ b/fastlane/metadata/android/en-US/images/phoneScreenshots/0_65.png @@ -1 +1 @@ -../../../../../screenshots/en_US/0_65.png \ No newline at end of file +../../../../../screenshots/en-US/0_65.png \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1_65.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1_65.png index cadbe517..7fd59b70 120000 --- a/fastlane/metadata/android/en-US/images/phoneScreenshots/1_65.png +++ b/fastlane/metadata/android/en-US/images/phoneScreenshots/1_65.png @@ -1 +1 @@ -../../../../../screenshots/en_US/1_65.png \ No newline at end of file +../../../../../screenshots/en-US/1_65.png \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2_65.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2_65.png index 22a15ecd..a487f4bb 120000 --- a/fastlane/metadata/android/en-US/images/phoneScreenshots/2_65.png +++ b/fastlane/metadata/android/en-US/images/phoneScreenshots/2_65.png @@ -1 +1 @@ -../../../../../screenshots/en_US/2_65.png \ No newline at end of file +../../../../../screenshots/en-US/2_65.png \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3_65.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3_65.png index 07332757..45f625a9 120000 --- a/fastlane/metadata/android/en-US/images/phoneScreenshots/3_65.png +++ b/fastlane/metadata/android/en-US/images/phoneScreenshots/3_65.png @@ -1 +1 @@ -../../../../../screenshots/en_US/3_65.png \ No newline at end of file +../../../../../screenshots/en-US/3_65.png \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt index 6c335e7a..0e46cec8 120000 --- a/fastlane/metadata/android/en-US/short_description.txt +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -1 +1 @@ -../../default/subtitle.txt \ No newline at end of file +../../en-US/subtitle.txt \ No newline at end of file diff --git a/fastlane/metadata/default/description.txt b/fastlane/metadata/default/description.txt deleted file mode 100644 index 9238b9bb..00000000 --- a/fastlane/metadata/default/description.txt +++ /dev/null @@ -1,5 +0,0 @@ -tooot is an open source, simple yet elegant Mastodon mobile client. - -A Mastodon (https://joinmastodon.org/) account is required to use this app. - -If you have suggestions, please reach out to @tooot@xmflsct.com or support@tooot.ap. \ No newline at end of file diff --git a/fastlane/metadata/default/description.txt b/fastlane/metadata/default/description.txt new file mode 120000 index 00000000..8637407c --- /dev/null +++ b/fastlane/metadata/default/description.txt @@ -0,0 +1 @@ +../en-US/description.txt \ No newline at end of file diff --git a/fastlane/metadata/default/release_notes.txt b/fastlane/metadata/default/release_notes.txt deleted file mode 100644 index 8b137891..00000000 --- a/fastlane/metadata/default/release_notes.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/fastlane/metadata/default/release_notes.txt b/fastlane/metadata/default/release_notes.txt new file mode 120000 index 00000000..457102d1 --- /dev/null +++ b/fastlane/metadata/default/release_notes.txt @@ -0,0 +1 @@ +../en-US/release_notes.txt \ No newline at end of file diff --git a/fastlane/metadata/default/subtitle.txt b/fastlane/metadata/default/subtitle.txt deleted file mode 100644 index 41d2c9e8..00000000 --- a/fastlane/metadata/default/subtitle.txt +++ /dev/null @@ -1 +0,0 @@ -Open source Mastodon client \ No newline at end of file diff --git a/fastlane/metadata/default/subtitle.txt b/fastlane/metadata/default/subtitle.txt new file mode 120000 index 00000000..8af515bb --- /dev/null +++ b/fastlane/metadata/default/subtitle.txt @@ -0,0 +1 @@ +../en-US/subtitle.txt \ No newline at end of file diff --git a/fastlane/metadata/en-US/description.txt b/fastlane/metadata/en-US/description.txt new file mode 100644 index 00000000..9238b9bb --- /dev/null +++ b/fastlane/metadata/en-US/description.txt @@ -0,0 +1,5 @@ +tooot is an open source, simple yet elegant Mastodon mobile client. + +A Mastodon (https://joinmastodon.org/) account is required to use this app. + +If you have suggestions, please reach out to @tooot@xmflsct.com or support@tooot.ap. \ No newline at end of file diff --git a/fastlane/metadata/en-US/release_notes.txt b/fastlane/metadata/en-US/release_notes.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/fastlane/metadata/en-US/release_notes.txt @@ -0,0 +1 @@ + diff --git a/fastlane/metadata/en-US/subtitle.txt b/fastlane/metadata/en-US/subtitle.txt new file mode 100644 index 00000000..41d2c9e8 --- /dev/null +++ b/fastlane/metadata/en-US/subtitle.txt @@ -0,0 +1 @@ +Open source Mastodon client \ No newline at end of file diff --git a/fastlane/metadata/zh-Hans/subtitle.txt b/fastlane/metadata/zh-Hans/subtitle.txt index 644b04f2..8b6cf09a 100644 --- a/fastlane/metadata/zh-Hans/subtitle.txt +++ b/fastlane/metadata/zh-Hans/subtitle.txt @@ -1 +1 @@ -开源长毛象客户端 \ No newline at end of file +开源毛象客户端 \ No newline at end of file diff --git a/fastlane/screenshots/en_US/0_55.png b/fastlane/screenshots/en-US/0_55.png similarity index 100% rename from fastlane/screenshots/en_US/0_55.png rename to fastlane/screenshots/en-US/0_55.png diff --git a/fastlane/screenshots/en_US/0_65.png b/fastlane/screenshots/en-US/0_65.png similarity index 100% rename from fastlane/screenshots/en_US/0_65.png rename to fastlane/screenshots/en-US/0_65.png diff --git a/fastlane/screenshots/en_US/1_55.png b/fastlane/screenshots/en-US/1_55.png similarity index 100% rename from fastlane/screenshots/en_US/1_55.png rename to fastlane/screenshots/en-US/1_55.png diff --git a/fastlane/screenshots/en_US/1_65.png b/fastlane/screenshots/en-US/1_65.png similarity index 100% rename from fastlane/screenshots/en_US/1_65.png rename to fastlane/screenshots/en-US/1_65.png diff --git a/fastlane/screenshots/en_US/2_55.png b/fastlane/screenshots/en-US/2_55.png similarity index 100% rename from fastlane/screenshots/en_US/2_55.png rename to fastlane/screenshots/en-US/2_55.png diff --git a/fastlane/screenshots/en_US/2_65.png b/fastlane/screenshots/en-US/2_65.png similarity index 100% rename from fastlane/screenshots/en_US/2_65.png rename to fastlane/screenshots/en-US/2_65.png diff --git a/fastlane/screenshots/en_US/3_55.png b/fastlane/screenshots/en-US/3_55.png similarity index 100% rename from fastlane/screenshots/en_US/3_55.png rename to fastlane/screenshots/en-US/3_55.png diff --git a/fastlane/screenshots/en_US/3_65.png b/fastlane/screenshots/en-US/3_65.png similarity index 100% rename from fastlane/screenshots/en_US/3_65.png rename to fastlane/screenshots/en-US/3_65.png diff --git a/ios/en.lproj/InfoPlist.strings b/ios/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..1787913e --- /dev/null +++ b/ios/en.lproj/InfoPlist.strings @@ -0,0 +1,11 @@ +/* + InfoPlist.strings + tooot + + Created by Zheng Zhiyuan (SEBD) on 2021-04-16. + +*/ + +"NSCameraUsageDescription" = "Allow tooot to capture photo or video and attach it to your toot"; +"NSPhotoLibraryAddUsageDescription" = "Allow tooot to save an image to your camera roll"; +"NSPhotoLibraryUsageDescription" = "Allow tooot to access your camera roll to attach photos or videos to your toot"; diff --git a/ios/tooot.xcodeproj/project.pbxproj b/ios/tooot.xcodeproj/project.pbxproj index 3b6db793..6c0f8b0b 100644 --- a/ios/tooot.xcodeproj/project.pbxproj +++ b/ios/tooot.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; }; 5E36538325C9B8BD009F93EE /* RootViewColor.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E36538225C9B8BD009F93EE /* RootViewColor.xcassets */; }; + 5EE088C926297820007E5FEC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5EE088CB26297820007E5FEC /* InfoPlist.strings */; }; 5EE44DD62600124E00A9BCED /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EE44DD52600124E00A9BCED /* File.swift */; }; 96905EF65AED1B983A6B3ABC /* libPods-tooot.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-tooot.a */; }; BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; }; @@ -30,6 +31,8 @@ 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = tooot/main.m; sourceTree = ""; }; 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-tooot.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-tooot.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 5E36538225C9B8BD009F93EE /* RootViewColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = RootViewColor.xcassets; path = tooot/RootViewColor.xcassets; sourceTree = ""; }; + 5EE088CA26297820007E5FEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 5EE088CD2629786B007E5FEC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = ""; }; 5EE44DD42600124E00A9BCED /* tooot-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "tooot-Bridging-Header.h"; sourceTree = ""; }; 5EE44DD52600124E00A9BCED /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; 6C2E3173556A471DD304B334 /* Pods-tooot.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tooot.debug.xcconfig"; path = "Target Support Files/Pods-tooot/Pods-tooot.debug.xcconfig"; sourceTree = ""; }; @@ -67,6 +70,7 @@ AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */, 5E36538225C9B8BD009F93EE /* RootViewColor.xcassets */, B96B72E5384D44A7B240B27E /* GoogleService-Info.plist */, + 5EE088CB26297820007E5FEC /* InfoPlist.strings */, ); name = tooot; sourceTree = ""; @@ -177,6 +181,7 @@ knownRegions = ( en, Base, + "zh-Hans", ); mainGroup = 83CBB9F61A601CBA00E9B192; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; @@ -194,6 +199,7 @@ buildActionMask = 2147483647; files = ( 5E36538325C9B8BD009F93EE /* RootViewColor.xcassets in Resources */, + 5EE088C926297820007E5FEC /* InfoPlist.strings in Resources */, BB2F792D24A3F905000567C9 /* Expo.plist in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, @@ -321,6 +327,15 @@ path = tooot; sourceTree = ""; }; + 5EE088CB26297820007E5FEC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5EE088CA26297820007E5FEC /* en */, + 5EE088CD2629786B007E5FEC /* zh-Hans */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/ios/tooot/Info.plist b/ios/tooot/Info.plist index eb35c58c..e325df39 100644 --- a/ios/tooot/Info.plist +++ b/ios/tooot/Info.plist @@ -50,16 +50,16 @@ + NSMicrophoneUsageDescription + $(PRODUCT_NAME) DOES NOT need microphone permission. Please reject this request. NSCameraUsageDescription - Give $(PRODUCT_NAME) permission to access your camera + Allow $(PRODUCT_NAME) to capture photo or video and attach it to your toot NSLocationWhenInUseUsageDescription - NSMicrophoneUsageDescription - Give $(PRODUCT_NAME) permission to use your microphone NSPhotoLibraryAddUsageDescription - Give $(PRODUCT_NAME) permission to save photos + Allow $(PRODUCT_NAME) to save an image to your camera roll NSPhotoLibraryUsageDescription - Give $(PRODUCT_NAME) permission to save photos + Allow $(PRODUCT_NAME) to access your camera roll to attach photos or videos to your toot UILaunchStoryboardName SplashScreen UIRequiredDeviceCapabilities diff --git a/ios/zh-Hans.lproj/InfoPlist.strings b/ios/zh-Hans.lproj/InfoPlist.strings new file mode 100644 index 00000000..41bee912 --- /dev/null +++ b/ios/zh-Hans.lproj/InfoPlist.strings @@ -0,0 +1,11 @@ +/* + InfoPlist.strings + tooot + + Created by Zheng Zhiyuan (SEBD) on 2021-04-16. + +*/ + +"NSCameraUsageDescription" = "允许tooot拍摄图片或视频,以添加嘟文附件"; +"NSPhotoLibraryAddUsageDescription" = "允许tooot保存图片至相册"; +"NSPhotoLibraryUsageDescription" = "允许tooot读取相册图片或视频,以添加嘟文附件"; diff --git a/package.json b/package.json index 2de1612d..5079cca4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "210317", "major": 1, "minor": 0, - "patch": 0, + "patch": 1, "expo": "40.0.0" }, "description": "tooot app for Mastodon", diff --git a/src/@types/react-navigation.d.ts b/src/@types/react-navigation.d.ts index acf59127..f90844f0 100644 --- a/src/@types/react-navigation.d.ts +++ b/src/@types/react-navigation.d.ts @@ -57,6 +57,7 @@ declare namespace Nav { 'Screen-ImagesViewer': { imageUrls: { id: Mastodon.Attachment['id'] + preview_url: Mastodon.AttachmentImage['preview_url'] url: Mastodon.AttachmentImage['url'] remote_url?: Mastodon.AttachmentImage['remote_url'] blurhash: Mastodon.AttachmentImage['blurhash'] diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index 37cac47f..62027dfb 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -67,8 +67,8 @@ const GracefullyImage = React.memo( setImageLoaded(true) setImageDimensions && setImageDimensions({ - width: nativeEvent.width, - height: nativeEvent.height + width: nativeEvent.source.width, + height: nativeEvent.source.height }) }, [source.uri] @@ -83,15 +83,20 @@ const GracefullyImage = React.memo( () => uri.preview && !imageLoaded ? ( ) : null, - [imageLoaded] + [] ) const originalView = useMemo( () => ( + ) } else { return ( ) } @@ -146,7 +158,7 @@ const GracefullyImage = React.memo( ) const styles = StyleSheet.create({ - blurhash: { + placeholder: { width: '100%', height: '100%', position: 'absolute' diff --git a/src/components/Parse/HTML.tsx b/src/components/Parse/HTML.tsx index ddbc8e7a..4d0589be 100644 --- a/src/components/Parse/HTML.tsx +++ b/src/components/Parse/HTML.tsx @@ -128,7 +128,8 @@ const renderNode = ({ }) }} > - {content || (showFullLink ? href : domain[1])} + {(content && content !== href && content) || + (showFullLink ? href : domain[1])} {!shouldBeTag ? ( { CameraRoll.save(image.url) - .then(() => haptics('Success')) + .then(() => { + haptics('Success') + }) .catch(() => { if (image.remote_url) { CameraRoll.save(image.remote_url) diff --git a/src/screens/ImagesViewer.tsx b/src/screens/ImagesViewer.tsx index ed4eded8..1d4e63de 100644 --- a/src/screens/ImagesViewer.tsx +++ b/src/screens/ImagesViewer.tsx @@ -11,15 +11,19 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import ImageViewer from './ImageViewer/Root' +import { saveAndroid, saveIos } from './ImageViewer/save' const saveImage = async ( image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0] ) => { - const save = require('./ImageViewer/save') - Platform.select({ - ios: save.saveIos(image), - android: save.saveAndroid(image) - }) + switch (Platform.OS) { + case 'ios': + saveIos(image) + break + case 'android': + saveAndroid(image) + break + } } const HeaderComponent = React.memo( @@ -113,6 +117,7 @@ const ScreenImagesViewer = ({ navigation }: ScreenImagesViewerProp) => { if (imageUrls.length === 0) { + navigation.goBack() return null } diff --git a/src/screens/Tabs/Me/Settings/Tooot.tsx b/src/screens/Tabs/Me/Settings/Tooot.tsx index af826876..1315c1fe 100644 --- a/src/screens/Tabs/Me/Settings/Tooot.tsx +++ b/src/screens/Tabs/Me/Settings/Tooot.tsx @@ -2,7 +2,6 @@ import analytics from '@components/analytics' import Icon from '@components/Icon' import { MenuContainer, MenuRow } from '@components/Menu' import { useNavigation } from '@react-navigation/native' -import { useSearchQuery } from '@utils/queryHooks/search' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import * as Updates from 'expo-updates' @@ -20,11 +19,6 @@ const SettingsTooot: React.FC = () => { const { theme } = useTheme() const { t } = useTranslation('screenTabs') - const { isLoading, data } = useSearchQuery({ - term: '@tooot@xmflsct.com', - options: { enabled: instanceActive !== -1 } - }) - return ( { }} /> {__DEV__ || - ['production', 'development'].some(channel => + ['release', 'development'].some(channel => Updates.releaseChannel?.includes(channel) ) ? ( { ) : null} { } iconBack='ChevronRight' onPress={() => { - const foundAccounts = data?.accounts.filter( - account => - account.acct === 'tooot@xmflsct.com' || - account.url === 'https://social.xmflsct.com/@tooot' - ) - if (foundAccounts?.length === 1) { + if (instanceActive !== -1) { navigation.navigate('Screen-Compose', { type: 'conversation', - accts: [foundAccounts[0].acct] + accts: ['tooot@xmflsct.com'] }) } else { WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot') diff --git a/src/startup/audio.ts b/src/startup/audio.ts index cfe6e475..f92dc883 100644 --- a/src/startup/audio.ts +++ b/src/startup/audio.ts @@ -7,8 +7,7 @@ const audio = () => { playsInSilentModeIOS: true, interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX, interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX, - shouldDuckAndroid: true, - playThroughEarpieceAndroid: true + shouldDuckAndroid: true }) } diff --git a/src/utils/slices/contextsSlice.ts b/src/utils/slices/contextsSlice.ts index 8fc431cd..68287fec 100644 --- a/src/utils/slices/contextsSlice.ts +++ b/src/utils/slices/contextsSlice.ts @@ -40,7 +40,7 @@ const contextsSlice = createSlice({ initialState: contextsInitialState as ContextsState, reducers: { updateStoreReview: (state, action: PayloadAction<1>) => { - if (Updates.releaseChannel.includes('production')) { + if (Updates.releaseChannel.includes('release')) { state.storeReview.current = state.storeReview.current + action.payload if (state.storeReview.current === state.storeReview.context) { StoreReview.isAvailableAsync().then(() => StoreReview.requestReview())