Skip to content

Commit 41b78a1

Browse files
committed
Link CodeReference stats to the correct page.
1 parent f0773ec commit 41b78a1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

invert-report/src/jsMain/kotlin/com/squareup/invert/common/pages/HomeReportPage.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.squareup.invert.common.navigation.NavRouteRepo
1111
import com.squareup.invert.common.navigation.routes.BaseNavRoute
1212
import com.squareup.invert.common.utils.FormattingUtils.dateDisplayStr
1313
import com.squareup.invert.common.utils.FormattingUtils.formatDecimalSeparator
14+
import com.squareup.invert.models.StatDataType
1415
import kotlinx.coroutines.flow.map
1516
import org.jetbrains.compose.web.attributes.ATarget
1617
import org.jetbrains.compose.web.attributes.target
@@ -157,10 +158,14 @@ fun HomeComposable(
157158
A(href = "#", {
158159
onClick {
159160
navRouteRepo.updateNavRoute(
160-
StatDetailNavRoute(
161-
pluginIds = listOf(),
162-
statKeys = listOf(statTotal.key.key)
163-
)
161+
if (statTotal.key.dataType == StatDataType.CODE_REFERENCES) {
162+
CodeReferencesNavRoute(statKey = statTotal.key.key)
163+
} else {
164+
StatDetailNavRoute(
165+
pluginIds = listOf(),
166+
statKeys = listOf(statTotal.key.key)
167+
)
168+
}
164169
)
165170
}
166171
}) {

0 commit comments

Comments
 (0)