Skip to content

Commit

Permalink
Refactor: Replace UiEvents with Action in WorkplaceScreen
Browse files Browse the repository at this point in the history
Replaced `UiEvents.Insert` with `Action.Insert` when adding media in the `Workplace
Screen`. This change likely improves consistency by using a common action system instead of UI-specific events.

- Updated `mediaInsert` and the image picker result handler to use `Action.Insert` instead of `UiEvents.Insert`.
  • Loading branch information
youndon committed Dec 30, 2024
1 parent 6decca9 commit 7f795e9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import city.zouitel.audios.model.NoteAndAudio
import city.zouitel.audios.ui.component.AudioScreenModel
import city.zouitel.audios.ui.component.BasicAudioScreen
import city.zouitel.audios.ui.component.NoteAndAudioScreenModel
import city.zouitel.domain.utils.Action
import city.zouitel.links.model.NoteAndLink
import city.zouitel.links.ui.CacheLinks
import city.zouitel.links.ui.LinkCard
Expand Down Expand Up @@ -202,7 +203,7 @@ data class WorkplaceScreen(
Intent.FLAG_GRANT_READ_URI_PERMISSION
)
Random.nextLong().let {
mediaModel.sendUiEvent(UiEvents.Insert(Media(id = it,uid = uid, uri = uri.toString())))
mediaModel.sendAction(Action.Insert(Media(id = it,uid = uid, uri = uri.toString())))
}
}
}
Expand Down Expand Up @@ -445,7 +446,7 @@ data class WorkplaceScreen(

private fun mediaInsert(mediaModel: MediaScreenModel): (Uri) -> Unit = { uri ->
Random.nextLong().let {
mediaModel.sendUiEvent(UiEvents.Insert(Media(id = it, uri = uri.toString())))
mediaModel.sendAction(Action.Insert(Media(id = it, uri = uri.toString())))
}
}
}

0 comments on commit 7f795e9

Please sign in to comment.