Save remembered tabs per user (#57)

If the remember tab setting is enabled, tabs will be remembered per user
profile now
This commit is contained in:
damontecres 2025-10-22 19:24:17 -04:00 committed by GitHub
parent f5ee5eceab
commit b5771db54e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 98 additions and 39 deletions

View file

@ -3,10 +3,8 @@ package com.github.damontecres.wholphin.preferences
import androidx.datastore.core.CorruptionException
import androidx.datastore.core.Serializer
import com.google.protobuf.InvalidProtocolBufferException
import timber.log.Timber
import java.io.InputStream
import java.io.OutputStream
import java.util.UUID
import javax.inject.Inject
import kotlin.time.Duration.Companion.hours
import kotlin.time.Duration.Companion.seconds
@ -108,13 +106,3 @@ inline fun AppPreferences.updateInterfacePreferences(block: InterfacePreferences
update {
interfacePreferences = interfacePreferences.toBuilder().apply(block).build()
}
fun AppPreferences.rememberTab(
itemId: UUID,
index: Int,
): AppPreferences {
Timber.v("Updating $itemId tab to $index")
return updateInterfacePreferences {
putRememberedTabs(itemId.toString(), index)
}
}