Skip to content

Commit

Permalink
refactor: some changes in view model of text preview
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Oct 2, 2024
1 parent 3deecbd commit 2123686
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class PreviewTextViewModel(
private val contextProvider: ContextProvider,
private val coroutinesDispatcherProvider: CoroutinesDispatcherProvider,
getFileByIdAsStreamUseCase: GetFileByIdAsStreamUseCase,
idFile: Long
ocFile: OCFile
) : ViewModel() {

private val _menuOptions: MutableStateFlow<List<FileMenuOption>> = MutableStateFlow(emptyList())
val menuOptions: StateFlow<List<FileMenuOption>> = _menuOptions

private val currentFile: Flow<OCFile?> = getFileByIdAsStreamUseCase(GetFileByIdAsStreamUseCase.Params(idFile))
private val currentFile: Flow<OCFile?> = getFileByIdAsStreamUseCase(GetFileByIdAsStreamUseCase.Params(ocFile.id!!))

fun getCurrentFile(): Flow<OCFile?> = currentFile

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PreviewTextFragment : FileFragment() {
private lateinit var textLoadTask: TextLoadAsyncTask

private val previewTextViewModel by viewModel<PreviewTextViewModel> {
parametersOf(file.id)
parametersOf(requireArguments().getParcelable(EXTRA_FILE))
}
private val fileOperationsViewModel by viewModel<FileOperationsViewModel>()

Expand Down

0 comments on commit 2123686

Please sign in to comment.