kopia lustrzana https://github.com/vitorpamplona/amethyst
Updates observers when deleting notes
rodzic
3ebcfa111c
commit
5e066e2485
|
@ -106,19 +106,24 @@ class Note(val idHex: String) {
|
||||||
|
|
||||||
fun removeReply(note: Note) {
|
fun removeReply(note: Note) {
|
||||||
replies = replies - note
|
replies = replies - note
|
||||||
|
liveSet?.replies?.invalidateData()
|
||||||
}
|
}
|
||||||
fun removeBoost(note: Note) {
|
fun removeBoost(note: Note) {
|
||||||
boosts = boosts - note
|
boosts = boosts - note
|
||||||
|
liveSet?.boosts?.invalidateData()
|
||||||
}
|
}
|
||||||
fun removeReaction(note: Note) {
|
fun removeReaction(note: Note) {
|
||||||
reactions = reactions - note
|
reactions = reactions - note
|
||||||
|
liveSet?.reactions?.invalidateData()
|
||||||
}
|
}
|
||||||
fun removeZap(note: Note) {
|
fun removeZap(note: Note) {
|
||||||
if (zaps[note] != null) {
|
if (zaps[note] != null) {
|
||||||
zaps = zaps.minus(note)
|
zaps = zaps.minus(note)
|
||||||
|
liveSet?.zaps?.invalidateData()
|
||||||
} else if (zaps.containsValue(note)) {
|
} else if (zaps.containsValue(note)) {
|
||||||
val toRemove = zaps.filterValues { it == note }
|
val toRemove = zaps.filterValues { it == note }
|
||||||
zaps = zaps.minus(toRemove.keys)
|
zaps = zaps.minus(toRemove.keys)
|
||||||
|
liveSet?.zaps?.invalidateData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue