mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Implement saving highlight notes with the new edit note view
This commit is contained in:
parent
ddf7c51816
commit
a6c5e450a2
1 changed files with 11 additions and 18 deletions
|
|
@ -152,7 +152,7 @@ fun WebReaderLoadingContainer(slug: String? = null, requestID: String? = null,
|
|||
|
||||
val modalBottomSheetState = rememberModalBottomSheetState(
|
||||
initialValue = ModalBottomSheetValue.Hidden,
|
||||
skipHalfExpanded = bottomSheetState == BottomSheetState.EDITNOTE,
|
||||
skipHalfExpanded = bottomSheetState == BottomSheetState.EDITNOTE || bottomSheetState == BottomSheetState.HIGHLIGHTNOTE,
|
||||
confirmValueChange = {
|
||||
if (it == ModalBottomSheetValue.Hidden) {
|
||||
webReaderViewModel.resetBottomSheet()
|
||||
|
|
@ -234,25 +234,18 @@ fun WebReaderLoadingContainer(slug: String? = null, requestID: String? = null,
|
|||
}
|
||||
}
|
||||
BottomSheetState.HIGHLIGHTNOTE -> {
|
||||
webReaderViewModel.annotation?.let { annotation ->
|
||||
BottomSheetUI(title = "Edit Note") {
|
||||
AnnotationEditView(
|
||||
initialAnnotation = annotation,
|
||||
onSave = {
|
||||
webReaderViewModel.saveAnnotation(it)
|
||||
coroutineScope.launch {
|
||||
webReaderViewModel.resetBottomSheet()
|
||||
}
|
||||
},
|
||||
onCancel = {
|
||||
webReaderViewModel.cancelAnnotationEdit()
|
||||
coroutineScope.launch {
|
||||
webReaderViewModel.resetBottomSheet()
|
||||
}
|
||||
EditNoteModal(
|
||||
initialValue = webReaderViewModel.annotation,
|
||||
onDismiss = { save, note ->
|
||||
coroutineScope.launch {
|
||||
if (save) {
|
||||
webReaderViewModel.saveAnnotation(note ?: "")
|
||||
}
|
||||
)
|
||||
webReaderViewModel.annotation = null
|
||||
}
|
||||
webReaderViewModel.resetBottomSheet()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
BottomSheetState.LABELS -> {
|
||||
BottomSheetUI(title = "Notebook") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue