mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
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:
parent
f5ee5eceab
commit
b5771db54e
6 changed files with 98 additions and 39 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue