···11+/*
22+ * This Source Code Form is subject to the terms of the Mozilla Public
33+ * License, v. 2.0. If a copy of the MPL was not distributed with this
44+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
55+ */
66+package com.example.util.simpletimetracker.presentation.navigation
77+88+import androidx.navigation.NavHostController
99+1010+fun NavHostController.navigateToRoot(route: String) {
1111+ // Inspired by: https://stackoverflow.com/a/72856761/14765128
1212+ navigate(route) {
1313+ popUpTo(graph.startDestinationId) { inclusive = true }
1414+ graph.setStartDestination(route)
1515+ }
1616+}