Only calls invalidate if things change
This commit is contained in:
@@ -152,22 +152,30 @@ object NostrSingleEventDataSource : NostrDataSource("SingleEventFeed") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun add(eventId: Note) {
|
fun add(eventId: Note) {
|
||||||
eventsToWatch = eventsToWatch.plus(eventId)
|
if (!eventsToWatch.contains(eventId)) {
|
||||||
invalidateFilters()
|
eventsToWatch = eventsToWatch.plus(eventId)
|
||||||
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun remove(eventId: Note) {
|
fun remove(eventId: Note) {
|
||||||
eventsToWatch = eventsToWatch.minus(eventId)
|
if (eventsToWatch.contains(eventId)) {
|
||||||
invalidateFilters()
|
eventsToWatch = eventsToWatch.minus(eventId)
|
||||||
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addAddress(aTag: Note) {
|
fun addAddress(aTag: Note) {
|
||||||
addressesToWatch = addressesToWatch.plus(aTag)
|
if (!addressesToWatch.contains(aTag)) {
|
||||||
invalidateFilters()
|
addressesToWatch = addressesToWatch.plus(aTag)
|
||||||
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun removeAddress(aTag: Note) {
|
fun removeAddress(aTag: Note) {
|
||||||
addressesToWatch = addressesToWatch.minus(aTag)
|
if (addressesToWatch.contains(aTag)) {
|
||||||
invalidateFilters()
|
addressesToWatch = addressesToWatch.minus(aTag)
|
||||||
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,12 +64,16 @@ object NostrSingleUserDataSource : NostrDataSource("SingleUserFeed") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun add(user: User) {
|
fun add(user: User) {
|
||||||
usersToWatch = usersToWatch.plus(user)
|
if (!usersToWatch.contains(user)) {
|
||||||
invalidateFilters()
|
usersToWatch = usersToWatch.plus(user)
|
||||||
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun remove(user: User) {
|
fun remove(user: User) {
|
||||||
usersToWatch = usersToWatch.minus(user)
|
if (usersToWatch.contains(user)) {
|
||||||
invalidateFilters()
|
usersToWatch = usersToWatch.minus(user)
|
||||||
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user