mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-30 18:12:32 +02:00
Adds a ZapSplit view to MasterNodes in Thread
This commit is contained in:
@@ -3,6 +3,7 @@ package com.vitorpamplona.amethyst
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import android.util.Log
|
||||||
import androidx.compose.runtime.Immutable
|
import androidx.compose.runtime.Immutable
|
||||||
import com.fasterxml.jackson.module.kotlin.readValue
|
import com.fasterxml.jackson.module.kotlin.readValue
|
||||||
import com.vitorpamplona.amethyst.model.Account
|
import com.vitorpamplona.amethyst.model.Account
|
||||||
@@ -344,16 +345,18 @@ object LocalPreferences {
|
|||||||
Event.mapper.readValue<Nip47URI?>(it)
|
Event.mapper.readValue<Nip47URI?>(it)
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
Log.w("LocalPreferences", "Error Decoding Zap Payment Request Server ${getString(PrefKeys.ZAP_PAYMENT_REQUEST_SERVER, null)}", e)
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
val latestContactList = try {
|
val latestContactList = try {
|
||||||
getString(PrefKeys.LATEST_CONTACT_LIST, null)?.let {
|
getString(PrefKeys.LATEST_CONTACT_LIST, null)?.let {
|
||||||
|
println("Decoding Contact List: " + it)
|
||||||
Event.fromJson(it) as ContactListEvent?
|
Event.fromJson(it) as ContactListEvent?
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
e.printStackTrace()
|
Log.w("LocalPreferences", "Error Decoding Contact List ${getString(PrefKeys.LATEST_CONTACT_LIST, null)}", e)
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,6 +365,7 @@ object LocalPreferences {
|
|||||||
Event.mapper.readValue<Map<String, String>?>(it)
|
Event.mapper.readValue<Map<String, String>?>(it)
|
||||||
} ?: mapOf()
|
} ?: mapOf()
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
Log.w("LocalPreferences", "Error Decoding Language Preferences ${getString(PrefKeys.LANGUAGE_PREFS, null)}", e)
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
mapOf()
|
mapOf()
|
||||||
}
|
}
|
||||||
@@ -387,6 +391,7 @@ object LocalPreferences {
|
|||||||
Event.mapper.readValue<Map<String, Long>?>(it)
|
Event.mapper.readValue<Map<String, Long>?>(it)
|
||||||
} ?: mapOf()
|
} ?: mapOf()
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
Log.w("LocalPreferences", "Error Decoding Last Read per route ${getString(PrefKeys.LAST_READ_PER_ROUTE, null)}", e)
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
mapOf()
|
mapOf()
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@ import com.vitorpamplona.amethyst.ui.components.ObserveDisplayNip05Status
|
|||||||
import com.vitorpamplona.amethyst.ui.note.*
|
import com.vitorpamplona.amethyst.ui.note.*
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.ChannelHeader
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.ChannelHeader
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.HalfDoubleVertSpacer
|
||||||
import com.vitorpamplona.amethyst.ui.theme.SmallBorder
|
import com.vitorpamplona.amethyst.ui.theme.SmallBorder
|
||||||
import com.vitorpamplona.amethyst.ui.theme.lessImportantLink
|
import com.vitorpamplona.amethyst.ui.theme.lessImportantLink
|
||||||
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
||||||
@@ -463,6 +464,13 @@ fun NoteMaster(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val noteEvent = baseNote.event
|
||||||
|
val zapSplits = remember(noteEvent) { noteEvent?.hasZapSplitSetup() ?: false }
|
||||||
|
if (zapSplits && noteEvent != null) {
|
||||||
|
Spacer(modifier = HalfDoubleVertSpacer)
|
||||||
|
DisplayZapSplits(noteEvent, accountViewModel, nav)
|
||||||
|
}
|
||||||
|
|
||||||
ReactionsRow(note, true, accountViewModel, nav)
|
ReactionsRow(note, true, accountViewModel, nav)
|
||||||
|
|
||||||
Divider(
|
Divider(
|
||||||
|
Reference in New Issue
Block a user