Skip to content

Commit

Permalink
Fix Unsafe call to observe with Fragment instance as LifecycleOwner
Browse files Browse the repository at this point in the history
  • Loading branch information
shubertm committed Nov 5, 2024
1 parent 1e2b6c6 commit 2cfdab9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/dev/arkbuilders/arkmemo/utils/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import kotlin.io.path.extension
import kotlin.io.path.forEachLine

fun Fragment.observeSaveResult(result: LiveData<SaveNoteResult>) {
result.observe(this) {
result.observe(viewLifecycleOwner) {
if (!isResumed) return@observe

if (it == SaveNoteResult.SUCCESS_NEW || it == SaveNoteResult.SUCCESS_UPDATED) {
Expand Down

0 comments on commit 2cfdab9

Please sign in to comment.