Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import org.comixedproject.variant.reader.ReaderAPI
private const val TAG = "VariantViewModel"

private const val ADDRESS_SETTING = "server.address"
private const val LAST_DIRECTORY_SETTING = "server.last-directory"
private const val USERNAME_SETTING = "server.username"
private const val PASSWORD_SETTING = "server.password"

Expand Down Expand Up @@ -124,7 +125,7 @@ open class VariantViewModel(

private val _browsingState = MutableStateFlow<BrowsingState>(
viewModelScope, BrowsingState(
READER_ROOT,
settings.getString(LAST_DIRECTORY_SETTING, READER_ROOT),
"", "", emptyList<DirectoryEntry>(), emptyList<DownloadingState>()
)
)
Expand Down Expand Up @@ -192,6 +193,8 @@ open class VariantViewModel(
}

val directory = directoryRepository.findDirectory(path)
Log.debug(TAG, "Saving last visited directory: value=${path}")
settings.putString(LAST_DIRECTORY_SETTING, path)
Log.debug(TAG, "Updating browsing state: currentPath=${path}")
_browsingState.tryEmit(
BrowsingState(
Expand Down