Skip to content

Commit

Permalink
refactor: Tidy up functions with little logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Siobhan committed Jan 25, 2024
1 parent 538127b commit 70a9af0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ public void onPhotoPickerHidden() {
@Override
public void onPhotoPickerMediaChosen(@NonNull final List<? extends Uri> uriList) {
mEditorPhotoPicker.hidePhotoPicker();
mEditorMedia.onPhotoPickerMediaChosen(uriList);
mEditorMedia.addNewMediaItemsToEditorAsync(uriList, false);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ class EditorMedia @Inject constructor(
)
}
}

fun onPhotoPickerMediaChosen(uriList: List<Uri>) {
addNewMediaItemsToEditorAsync(uriList, false)
}
// endregion

// region Add existing media to a post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class StoryComposerActivity : ComposeLoopFrameActivity(),
it.hasExtra(MediaPickerConstants.EXTRA_MEDIA_URIS) -> {
data.getStringArrayExtra(MediaPickerConstants.EXTRA_MEDIA_URIS)?.let {
val uriList: List<Uri> = convertStringArrayIntoUrisList(it)
storyEditorMedia.onPhotoPickerMediaChosen(uriList)
storyEditorMedia.addNewMediaItemsToEditorAsync(uriList, false)
}
}
it.hasExtra(MediaBrowserActivity.RESULT_IDS) -> {
Expand Down Expand Up @@ -421,7 +421,7 @@ class StoryComposerActivity : ComposeLoopFrameActivity(),
val uriList: List<Uri> = convertStringArrayIntoUrisList(it)

if (uriList.isNotEmpty()) {
storyEditorMedia.onPhotoPickerMediaChosen(uriList)
storyEditorMedia.addNewMediaItemsToEditorAsync(uriList, false)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ class StoryEditorMedia @Inject constructor(
_uiState.value = AddingMediaToStoryIdle
}
}

fun onPhotoPickerMediaChosen(uriList: List<Uri>) {
addNewMediaItemsToEditorAsync(uriList, false)
}
// endregion

fun addExistingMediaToEditorAsync(source: AddExistingMediaSource, mediaIdList: List<Long>) {
Expand Down

0 comments on commit 70a9af0

Please sign in to comment.