fix: Context issues in fragment sheet.
All checks were successful
Check PR code / Lint (pull_request) Successful in 1m7s
Check PR code / build (pull_request) Successful in 12m15s

This commit is contained in:
Amine Bouabdallaoui 2024-12-30 22:12:38 +01:00
parent cd8b7aaf9d
commit 806e56e20b
2 changed files with 7 additions and 9 deletions

View File

@ -225,7 +225,7 @@ class ArticleFragment : Fragment(), DIAware {
}
this@ArticleFragment.item.unread = false
Toast.makeText(
context,
requireContext(),
R.string.marked_as_read,
Toast.LENGTH_LONG,
).show()

View File

@ -52,19 +52,17 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
false,
)
val context: Context? = context
if (context == null) {
dismiss()
Exception("FilterSheetFragment context is null").sendSilentlyWithAcraWithName("FilterSheetFragment > onCreateView")
} else {
try {
CoroutineScope(Dispatchers.Main).launch {
handleTagChips(context)
handleSourceChips(context)
handleTagChips(requireContext())
handleSourceChips(requireContext())
binding.progressBar2.visibility = GONE
binding.filterView.visibility = VISIBLE
}
} catch (e: IllegalStateException) {
dismiss()
e.sendSilentlyWithAcraWithName("FilterSheetFragment > onCreateView")
}
binding.floatingActionButton2.setOnClickListener {