Skip to content

Commit

Permalink
Resolved daily issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmedalijaK committed Feb 21, 2025
1 parent af72048 commit c1cef5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<ID>LongParameterList:NostrResources.kt$( eventId: String, eventIdToNostrEvent: Map&lt;String, NostrEvent&gt;, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, )</ID>
<ID>LongParameterList:NostrResources.kt$( eventIdToNostrEvent: Map&lt;String, NostrEvent&gt;, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, )</ID>
<ID>LongParameterList:NostrResources.kt$( refNote: PostData?, refPostAuthor: ProfileData?, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, eventIdToNostrEvent: Map&lt;String, NostrEvent&gt;, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, )</ID>
<ID>LongParameterList:NoteContent.kt$( onProfileClick: ((String) -&gt; Unit)?, onUrlClick: ((String) -&gt; Unit)?, onPostClick: ((String) -&gt; Unit)?, onHashtagClick: ((String) -&gt; Unit)?, onArticleClick: ((naddr: String) -&gt; Unit)?, onPrimalLegendsLeaderboardClick: (() -&gt; Unit)?, )</ID>
<ID>LongParameterList:NoteEditorViewModel.kt$NoteEditorViewModel$( @Assisted private val args: NoteEditorArgs, private val dispatcherProvider: CoroutineDispatcherProvider, private val fileAnalyser: FileAnalyser, private val activeAccountStore: ActiveAccountStore, private val feedRepository: FeedRepository, private val notePublishHandler: NotePublishHandler, private val attachmentRepository: AttachmentsRepository, private val highlightRepository: HighlightRepository, private val exploreRepository: ExploreRepository, private val profileRepository: ProfileRepository, private val articleRepository: ArticleRepository, )</ID>
<ID>LongParameterList:ProfileDetailsViewModel.kt$ProfileDetailsViewModel$( savedStateHandle: SavedStateHandle, private val dispatcherProvider: CoroutineDispatcherProvider, private val activeAccountStore: ActiveAccountStore, private val feedsRepository: FeedsRepository, private val profileRepository: ProfileRepository, private val mutedUserRepository: MutedUserRepository, private val zapHandler: ZapHandler, )</ID>
<ID>LongParameterList:SubscriptionsManager.kt$SubscriptionsManager$( dispatcherProvider: CoroutineDispatcherProvider, private val activeAccountStore: ActiveAccountStore, private val userRepository: UserRepository, private val nostrNotary: NostrNotary, private val appConfigProvider: AppConfigProvider, @PrimalCacheApiClient private val cacheApiClient: PrimalApiClient, @PrimalWalletApiClient private val walletApiClient: PrimalApiClient, )</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,16 @@ fun NoteContent(

annotation?.handleAnnotationClick(
onProfileClick = noteCallbacks.onProfileClick,
onUrlClick = onUrlClick,
onUrlClick = {
if (it.isPrimalLegendsUrl()) {
noteCallbacks.onPrimalLegendsLeaderboardClick
} else {
onUrlClick?.invoke(it)
}
},
onPostClick = noteCallbacks.onNoteClick,
onHashtagClick = noteCallbacks.onHashtagClick,
onArticleClick = noteCallbacks.onArticleClick,
onPrimalLegendsLeaderboardClick = noteCallbacks.onPrimalLegendsLeaderboardClick,
) ?: onClick?.invoke(offset)
},
)
Expand Down Expand Up @@ -261,8 +266,7 @@ fun NoteContent(
expanded = expanded,
onUrlClick = { url ->
when {
url.isPrimalLegendsUrl() ->
noteCallbacks.onPrimalLegendsLeaderboardClick?.invoke()
url.isPrimalLegendsUrl() -> noteCallbacks.onPrimalLegendsLeaderboardClick?.invoke()
else -> onUrlClick?.invoke(url)
}
},
Expand Down Expand Up @@ -376,16 +380,9 @@ private fun AnnotatedString.Range<String>.handleAnnotationClick(
onPostClick: ((String) -> Unit)?,
onHashtagClick: ((String) -> Unit)?,
onArticleClick: ((naddr: String) -> Unit)?,
onPrimalLegendsLeaderboardClick: (() -> Unit)?,
) = when (this.tag) {
PROFILE_ID_ANNOTATION_TAG -> onProfileClick?.invoke(this.item)
URL_ANNOTATION_TAG -> {
if (this.item.isPrimalLegendsUrl()) {
onPrimalLegendsLeaderboardClick?.invoke()
} else {
onUrlClick?.invoke(this.item)
}
}
URL_ANNOTATION_TAG -> onUrlClick?.invoke(this.item)
NOTE_ANNOTATION_TAG -> onPostClick?.invoke(this.item)
HASHTAG_ANNOTATION_TAG -> onHashtagClick?.invoke(this.item)
NOSTR_ADDRESS_ANNOTATION_TAG -> {
Expand Down

0 comments on commit c1cef5d

Please sign in to comment.