mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 08:23:00 +01:00
Prevent potential ISE in MediaPreviewV2Fragment.
This commit is contained in:
committed by
Cody Henthorne
parent
549992c08a
commit
1908723fbe
@@ -154,8 +154,9 @@ class MediaPreviewV2Fragment :
|
||||
val sorting = MediaTable.Sorting.deserialize(args.sorting.ordinal)
|
||||
val startingAttachmentId = PartAuthority.requireAttachmentId(args.initialMediaUri)
|
||||
val threadId = args.threadId
|
||||
viewModel.fetchAttachments(requireContext(), startingAttachmentId, threadId, sorting)
|
||||
val dbObserver = DatabaseObserver.Observer { viewModel.refetchAttachments(requireContext(), startingAttachmentId, threadId, sorting) }
|
||||
val appContext = requireContext().applicationContext
|
||||
viewModel.fetchAttachments(appContext, startingAttachmentId, threadId, sorting)
|
||||
val dbObserver = DatabaseObserver.Observer { viewModel.refetchAttachments(appContext, startingAttachmentId, threadId, sorting) }
|
||||
AppDependencies.databaseObserver.registerAttachmentUpdatedObserver(dbObserver)
|
||||
this.dbChangeObserver = dbObserver
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user