Implement clear on cancel of edit note
This commit is contained in:
@ -240,6 +240,8 @@ fun WebReaderLoadingContainer(slug: String? = null, requestID: String? = null,
|
||||
coroutineScope.launch {
|
||||
if (save) {
|
||||
webReaderViewModel.saveAnnotation(note ?: "")
|
||||
} else {
|
||||
webReaderViewModel.cancelAnnotation()
|
||||
}
|
||||
webReaderViewModel.annotation = null
|
||||
}
|
||||
|
||||
@ -328,6 +328,13 @@ class WebReaderViewModel @Inject constructor(
|
||||
cancelAnnotationEdit()
|
||||
}
|
||||
|
||||
fun cancelAnnotation() {
|
||||
val script = "var event = new Event('dismissHighlight');document.dispatchEvent(event);"
|
||||
|
||||
enqueueScript(script)
|
||||
cancelAnnotationEdit()
|
||||
}
|
||||
|
||||
fun cancelAnnotationEdit() {
|
||||
annotation = null
|
||||
resetBottomSheet()
|
||||
|
||||
Reference in New Issue
Block a user