Skip to content

Commit

Permalink
Repopulate tools on resume
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Nov 18, 2023
1 parent e996655 commit bb706b9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.kylecorry.trail_sense.tools.ui.sort.ToolSortType

class ToolsFragment : BoundFragment<FragmentToolsBinding>() {

private val tools by lazy { Tools.getTools(requireContext()) }
private var tools: List<Tool> = emptyList()
private val prefs by lazy { UserPreferences(requireContext()) }

private val pinnedToolManager by lazy { PinnedToolManager(prefs) }
Expand Down Expand Up @@ -101,6 +101,11 @@ class ToolsFragment : BoundFragment<FragmentToolsBinding>() {

}

override fun onResume() {
super.onResume()
tools = Tools.getTools(requireContext())
}

// TODO: Add a way to customize this
private fun updateQuickActions() {
ToolsQuickActionBinder(this, binding).bind()
Expand Down

0 comments on commit bb706b9

Please sign in to comment.