mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-17 21:31:57 +01:00
@Suppress("ProduceStateDoesNotAssignValue") until we figure out what's wrong with this lint.
This commit is contained in:
parent
35aeeb571c
commit
824cb4e5f1
@ -85,6 +85,7 @@ fun CashuPreview(
|
||||
cashutoken: String,
|
||||
accountViewModel: AccountViewModel,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val cashuData by produceState(
|
||||
initialValue = CachedCashuProcessor.cached(cashutoken),
|
||||
key1 = cashutoken,
|
||||
|
@ -69,13 +69,12 @@ fun LoadValueFromInvoice(
|
||||
lnbcWord: String,
|
||||
inner: @Composable (invoiceAmount: InvoiceAmount?) -> Unit,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val lnInvoice by
|
||||
produceState(initialValue = CachedLnInvoiceParser.cached(lnbcWord), key1 = lnbcWord) {
|
||||
withContext(Dispatchers.IO) {
|
||||
val newLnInvoice = CachedLnInvoiceParser.parse(lnbcWord)
|
||||
if (value != newLnInvoice) {
|
||||
value = newLnInvoice
|
||||
}
|
||||
val newLnInvoice = withContext(Dispatchers.Default) { CachedLnInvoiceParser.parse(lnbcWord) }
|
||||
if (value != newLnInvoice) {
|
||||
value = newLnInvoice
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@ fun LoadUrlPreview(
|
||||
if (!accountViewModel.settings.showUrlPreview.value) {
|
||||
ClickableUrl(urlText, url)
|
||||
} else {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val urlPreviewState by
|
||||
produceState(
|
||||
initialValue = UrlCachedPreviewer.cache.get(url) ?: UrlPreviewState.Loading,
|
||||
|
@ -81,6 +81,7 @@ fun AccountSwitchBottomSheet(
|
||||
accountViewModel: AccountViewModel,
|
||||
accountStateViewModel: AccountStateViewModel,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val accounts by
|
||||
produceState(initialValue = LocalPreferences.cachedAccounts()) {
|
||||
if (value == null) {
|
||||
|
@ -73,6 +73,7 @@ fun LoadDecryptedContentOrNull(
|
||||
accountViewModel: AccountViewModel,
|
||||
inner: @Composable (String?) -> Unit,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val decryptedContent by
|
||||
produceState(initialValue = accountViewModel.cachedDecrypt(note), key1 = note.event?.id()) {
|
||||
accountViewModel.decrypt(note) {
|
||||
|
@ -229,6 +229,7 @@ fun DecryptAndRenderZapGallery(
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val zapEvents by
|
||||
produceState(initialValue = accountViewModel.cachedDecryptAmountMessageInGroup(multiSetCard.zapEvents)) {
|
||||
accountViewModel.decryptAmountMessageInGroup(multiSetCard.zapEvents) { value = it }
|
||||
|
@ -892,6 +892,7 @@ fun ObserveLikeIcon(
|
||||
) {
|
||||
val reactionsState by baseNote.live().reactions.observeAsState()
|
||||
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val reactionType by
|
||||
produceState(initialValue = null as String?, key1 = reactionsState) {
|
||||
val newReactionType = accountViewModel.loadReactionTo(reactionsState?.note)
|
||||
@ -1226,6 +1227,7 @@ fun ObserveZapAmountText(
|
||||
val zapsState by baseNote.live().zaps.observeAsState()
|
||||
|
||||
if (zapsState?.note?.zapPayments?.isNotEmpty() == true) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val zapAmountTxt by
|
||||
produceState(initialValue = showAmount(baseNote.zapsAmount), key1 = zapsState) {
|
||||
zapsState?.note?.let {
|
||||
|
@ -122,6 +122,7 @@ fun RenderRelay(
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val relayInfo by
|
||||
produceState(
|
||||
initialValue = Nip11CachedRetriever.getFromCache(relay.url),
|
||||
|
@ -57,6 +57,7 @@ fun DisplayUncitedHashtags(
|
||||
callbackUri: String? = null,
|
||||
nav: INav,
|
||||
) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val unusedHashtags by
|
||||
produceState(initialValue = emptyList<String>()) {
|
||||
val tagsInEvent = event.hashtags()
|
||||
|
@ -87,6 +87,7 @@ fun RenderFhirResource(
|
||||
|
||||
@Composable
|
||||
fun RenderFhirResource(event: FhirResourceEvent) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val state by produceState(initialValue = FhirElementDatabase(), key1 = event) {
|
||||
withContext(Dispatchers.Default) {
|
||||
parseResourceBundleOrNull(event.content)?.let {
|
||||
|
@ -532,6 +532,7 @@ private fun RenderReply(
|
||||
onWantsToEditDraft: (Note) -> Unit,
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
val replyTo =
|
||||
produceState(initialValue = note.replyTo?.lastOrNull()) {
|
||||
accountViewModel.unwrapIfNeeded(value) {
|
||||
|
@ -30,6 +30,7 @@ fun <K, V> produceCachedStateAsync(
|
||||
cache: AsyncCachedState<K, V>,
|
||||
key: K,
|
||||
): State<V?> =
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
produceState(initialValue = cache.cached(key), key1 = key) {
|
||||
cache.update(key) {
|
||||
value = it
|
||||
@ -42,6 +43,7 @@ fun <K, V> produceCachedStateAsync(
|
||||
key: String,
|
||||
updateValue: K,
|
||||
): State<V?> =
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
produceState(initialValue = cache.cached(updateValue), key1 = key) {
|
||||
cache.update(updateValue) {
|
||||
value = it
|
||||
|
@ -30,6 +30,7 @@ fun <K, V> produceCachedState(
|
||||
cache: CachedState<K, V>,
|
||||
key: K,
|
||||
): State<V?> =
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
produceState(initialValue = cache.cached(key), key1 = key) {
|
||||
val newValue = cache.update(key)
|
||||
if (value != newValue) {
|
||||
@ -43,6 +44,7 @@ fun <K, V> produceCachedState(
|
||||
key: String,
|
||||
updateValue: K,
|
||||
): State<V?> =
|
||||
@Suppress("ProduceStateDoesNotAssignValue")
|
||||
produceState(initialValue = cache.cached(updateValue), key1 = key) {
|
||||
val newValue = cache.update(updateValue)
|
||||
if (value != newValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user