Skip to content

Commit

Permalink
Code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroBorgesFerreira committed Jul 14, 2023
1 parent c901b9a commit 1054d99
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package br.com.leandroferreira.editor

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.github.leandroborgesferreira.storyteller.backstack.BackstackHandler
Expand Down Expand Up @@ -32,7 +31,6 @@ class NoteDetailsViewModel(
private val _editModeState = MutableStateFlow(true)
val editModeState: StateFlow<Boolean> = _editModeState

val toEditState = storyTellerManager.positionsOnEdit
val isEditState = storyTellerManager.positionsOnEdit.map { set ->
set.isNotEmpty()
}.stateIn(viewModelScope, started = SharingStarted.Lazily, initialValue = false)
Expand All @@ -48,10 +46,6 @@ class NoteDetailsViewModel(
private val _documentState: MutableStateFlow<Document?> = MutableStateFlow(null)
val documentState: StateFlow<Document?> = _documentState.asStateFlow()

fun toggleEdit() {
_editModeState.value = !_editModeState.value
}

fun deleteSelection() {
storyTellerManager.deleteSelection()
}
Expand All @@ -72,7 +66,6 @@ class NoteDetailsViewModel(
lastUpdatedAt = Date()
)

Log.d("NoteDetailsViewModel", "saving document!!")
documentRepository.saveDocument(document)
_documentState.value = document
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package br.com.leandroferreira.note_menu.viewmodel

import android.content.Context
import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import br.com.leandroferreira.note_menu.data.usecase.NotesConfigurationRepository
Expand Down Expand Up @@ -59,7 +58,6 @@ class ChooseNoteViewModel(
fun requestDocuments(force: Boolean) {
if (documentsState.value !is ResultData.Complete || force) {
viewModelScope.launch(Dispatchers.IO) {
Log.d("ChooseNoteViewModel", "refreshNotes")
refreshNotes()
}
}
Expand Down Expand Up @@ -140,7 +138,6 @@ class ChooseNoteViewModel(

try {
val data = notesUseCase.loadDocuments()
Log.d("ChooseNoteViewModel", "notes: ${data.joinToString { it.title }}")
_notesArrangement.value = NotesArrangement.fromString(notesConfig.arrangementPref())
_documentsState.value = ResultData.Complete(data)
} catch (e: Exception) {
Expand Down

0 comments on commit 1054d99

Please sign in to comment.