mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-22 21:35:33 +02:00
Removes unecessary @ExperimentalTime tag
This commit is contained in:
@@ -7,7 +7,6 @@ import com.vitorpamplona.amethyst.ui.actions.updated
|
|||||||
import com.vitorpamplona.quartz.events.ChannelMessageEvent
|
import com.vitorpamplona.quartz.events.ChannelMessageEvent
|
||||||
import com.vitorpamplona.quartz.events.ChatroomKey
|
import com.vitorpamplona.quartz.events.ChatroomKey
|
||||||
import com.vitorpamplona.quartz.events.ChatroomKeyable
|
import com.vitorpamplona.quartz.events.ChatroomKeyable
|
||||||
import kotlin.time.ExperimentalTime
|
|
||||||
import kotlin.time.measureTimedValue
|
import kotlin.time.measureTimedValue
|
||||||
|
|
||||||
class ChatroomListKnownFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
class ChatroomListKnownFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
||||||
@@ -50,7 +49,6 @@ class ChatroomListKnownFeedFilter(val account: Account) : AdditiveFeedFilter<Not
|
|||||||
.reversed()
|
.reversed()
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
override fun updateListWith(oldList: List<Note>, newItems: Set<Note>): List<Note> {
|
override fun updateListWith(oldList: List<Note>, newItems: Set<Note>): List<Note> {
|
||||||
val (feed, elapsed) = measureTimedValue {
|
val (feed, elapsed) = measureTimedValue {
|
||||||
val me = account.userProfile()
|
val me = account.userProfile()
|
||||||
|
@@ -6,7 +6,6 @@ import com.vitorpamplona.amethyst.ui.actions.updated
|
|||||||
import com.vitorpamplona.quartz.events.ChatroomKey
|
import com.vitorpamplona.quartz.events.ChatroomKey
|
||||||
import com.vitorpamplona.quartz.events.ChatroomKeyable
|
import com.vitorpamplona.quartz.events.ChatroomKeyable
|
||||||
import com.vitorpamplona.quartz.events.PrivateDmEvent
|
import com.vitorpamplona.quartz.events.PrivateDmEvent
|
||||||
import kotlin.time.ExperimentalTime
|
|
||||||
import kotlin.time.measureTimedValue
|
import kotlin.time.measureTimedValue
|
||||||
|
|
||||||
class ChatroomListNewFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
class ChatroomListNewFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
||||||
@@ -38,7 +37,6 @@ class ChatroomListNewFeedFilter(val account: Account) : AdditiveFeedFilter<Note>
|
|||||||
.reversed()
|
.reversed()
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
override fun updateListWith(oldList: List<Note>, newItems: Set<Note>): List<Note> {
|
override fun updateListWith(oldList: List<Note>, newItems: Set<Note>): List<Note> {
|
||||||
val (feed, elapsed) = measureTimedValue {
|
val (feed, elapsed) = measureTimedValue {
|
||||||
val me = account.userProfile()
|
val me = account.userProfile()
|
||||||
|
@@ -2,11 +2,9 @@ package com.vitorpamplona.amethyst.ui.dal
|
|||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.vitorpamplona.amethyst.service.checkNotInMainThread
|
import com.vitorpamplona.amethyst.service.checkNotInMainThread
|
||||||
import kotlin.time.ExperimentalTime
|
|
||||||
import kotlin.time.measureTimedValue
|
import kotlin.time.measureTimedValue
|
||||||
|
|
||||||
abstract class FeedFilter<T> {
|
abstract class FeedFilter<T> {
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
fun loadTop(): List<T> {
|
fun loadTop(): List<T> {
|
||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
|
||||||
@@ -33,7 +31,6 @@ abstract class AdditiveFeedFilter<T> : FeedFilter<T>() {
|
|||||||
abstract fun applyFilter(collection: Set<T>): Set<T>
|
abstract fun applyFilter(collection: Set<T>): Set<T>
|
||||||
abstract fun sort(collection: Set<T>): List<T>
|
abstract fun sort(collection: Set<T>): List<T>
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
open fun updateListWith(oldList: List<T>, newItems: Set<T>): List<T> {
|
open fun updateListWith(oldList: List<T>, newItems: Set<T>): List<T> {
|
||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
|
||||||
|
@@ -34,7 +34,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
import kotlinx.coroutines.flow.update
|
import kotlinx.coroutines.flow.update
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.time.ExperimentalTime
|
|
||||||
import kotlin.time.measureTimedValue
|
import kotlin.time.measureTimedValue
|
||||||
|
|
||||||
@Stable
|
@Stable
|
||||||
@@ -270,7 +269,6 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
|||||||
private val bundler = BundledUpdate(1000, Dispatchers.IO)
|
private val bundler = BundledUpdate(1000, Dispatchers.IO)
|
||||||
private val bundlerInsert = BundledInsert<Set<Note>>(1000, Dispatchers.IO)
|
private val bundlerInsert = BundledInsert<Set<Note>>(1000, Dispatchers.IO)
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
fun invalidateData(ignoreIfDoing: Boolean = false) {
|
fun invalidateData(ignoreIfDoing: Boolean = false) {
|
||||||
bundler.invalidate(ignoreIfDoing) {
|
bundler.invalidate(ignoreIfDoing) {
|
||||||
// adds the time to perform the refresh into this delay
|
// adds the time to perform the refresh into this delay
|
||||||
@@ -282,7 +280,6 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
fun invalidateDataAndSendToTop() {
|
fun invalidateDataAndSendToTop() {
|
||||||
clear()
|
clear()
|
||||||
bundler.invalidate(false) {
|
bundler.invalidate(false) {
|
||||||
@@ -296,7 +293,6 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
fun checkKeysInvalidateDataAndSendToTop() {
|
fun checkKeysInvalidateDataAndSendToTop() {
|
||||||
if (lastFeedKey != localFilter.feedKey()) {
|
if (lastFeedKey != localFilter.feedKey()) {
|
||||||
clear()
|
clear()
|
||||||
@@ -312,7 +308,6 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
fun invalidateInsertData(newItems: Set<Note>) {
|
fun invalidateInsertData(newItems: Set<Note>) {
|
||||||
bundlerInsert.invalidateList(newItems) {
|
bundlerInsert.invalidateList(newItems) {
|
||||||
val newObjects = it.flatten().toSet()
|
val newObjects = it.flatten().toSet()
|
||||||
|
Reference in New Issue
Block a user