diff --git a/resources/strings/src/commonMain/kotlin/dev/sasikanth/rss/reader/resources/strings/EnTwineStrings.kt b/resources/strings/src/commonMain/kotlin/dev/sasikanth/rss/reader/resources/strings/EnTwineStrings.kt index 0365e4e87..576053fa8 100644 --- a/resources/strings/src/commonMain/kotlin/dev/sasikanth/rss/reader/resources/strings/EnTwineStrings.kt +++ b/resources/strings/src/commonMain/kotlin/dev/sasikanth/rss/reader/resources/strings/EnTwineStrings.kt @@ -111,7 +111,7 @@ val EnTwineStrings = postsToday = "Today", openSource = "Support Open Source", openSourceDesc = - "Twine is built on open-source technologies and is free to use. You can find the source code for Twine and some of my other popular projects on GitHub. Click here to open GitHub and tip for the project.", + "Twine is an open source project and is available for free to use. Click here to know more on how to support this project or, view source code of Twine or some of my other popular projects.", markAsRead = "Mark as Read", markAsUnRead = "Mark as Unread", removeFeed = "Remove feed", diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/OpmlManager.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/OpmlManager.kt index ca71074ae..bae0585c2 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/OpmlManager.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/OpmlManager.kt @@ -141,7 +141,7 @@ class OpmlManager( } } else { feedLinks.reversed().forEachIndexed { index, feed -> - launch { rssRepository.addFeed(feedLink = feed.link, title = feed.title) } + rssRepository.addFeed(feedLink = feed.link, title = feed.title) sendProgress(index, totalFeedCount) } } diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt index c3fa88b63..b6eaf3a38 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt @@ -246,7 +246,8 @@ private fun OpenSource(openLink: () -> Unit) { Surface( color = AppTheme.colorScheme.tintedSurface, shape = MaterialTheme.shapes.extraLarge, - modifier = Modifier.fillMaxWidth().padding(16.dp).clickable { openLink() } + modifier = Modifier.fillMaxWidth().padding(16.dp), + onClick = { openLink() } ) { Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.padding(16.dp)) { Icon( diff --git a/shared/src/iosMain/kotlin/dev/sasikanth/rss/reader/platform/IOSLinkHandler.kt b/shared/src/iosMain/kotlin/dev/sasikanth/rss/reader/platform/IOSLinkHandler.kt index 9218e43e9..7fc1b5cce 100644 --- a/shared/src/iosMain/kotlin/dev/sasikanth/rss/reader/platform/IOSLinkHandler.kt +++ b/shared/src/iosMain/kotlin/dev/sasikanth/rss/reader/platform/IOSLinkHandler.kt @@ -44,9 +44,7 @@ class IOSLinkHandler( BrowserType.Default -> { val canOpenUrl = UIApplication.sharedApplication().canOpenURL(url) if (canOpenUrl) { - dispatch_async(dispatch_get_main_queue()) { - UIApplication.sharedApplication().openURL(url) - } + openBrowser(url) } else { inAppBrowser(url) } @@ -57,10 +55,18 @@ class IOSLinkHandler( } } + private fun openBrowser(url: NSURL) { + dispatch_async(dispatch_get_main_queue()) { UIApplication.sharedApplication().openURL(url) } + } + private fun inAppBrowser(url: NSURL) { - val safari = SFSafariViewController(url) - safari.modalPresentationStyle = UIModalPresentationPageSheet + try { + val safari = SFSafariViewController(url) + safari.modalPresentationStyle = UIModalPresentationPageSheet - uiViewControllerProvider().presentViewController(safari, animated = true, completion = null) + uiViewControllerProvider().presentViewController(safari, animated = true, completion = null) + } catch (e: Exception) { + openBrowser(url) + } } }