fix: Replace unsafe .toFixed() calls with safeFixed() in analytics views
- AnalyticsView: avg_players, uptime_percentage - WipeAnalyticsView: success_rate, population curve, durations, CSV export - PlayerRetentionView: retention percentages, session duration, tooltip - MapAnalyticsView: rotation effectiveness, performance metrics, table All analytics views now use safe formatter utilities with optional chaining to prevent null/undefined runtime errors when displaying numeric data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { useApi } from '@/composables/useApi'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import type { Module } from '@/types'
|
||||
import { ShoppingCart, Package, Search, Filter, X, Check, Download, AlertCircle } from 'lucide-vue-next'
|
||||
import { safeFixed } from '@/utils/formatters'
|
||||
|
||||
const api = useApi()
|
||||
const auth = useAuthStore()
|
||||
@@ -252,7 +253,7 @@ onMounted(() => {
|
||||
<div>
|
||||
<div class="flex items-start justify-between gap-2 mb-1">
|
||||
<h3 class="text-base font-semibold text-neutral-100">{{ module.name }}</h3>
|
||||
<span class="text-lg font-bold text-oxide-400 shrink-0">${{ module.price.toFixed(2) }}</span>
|
||||
<span class="text-lg font-bold text-oxide-400 shrink-0">${{ safeFixed(module.price, 2) }}</span>
|
||||
</div>
|
||||
<p class="text-sm text-neutral-500 line-clamp-2">{{ module.description }}</p>
|
||||
</div>
|
||||
@@ -385,7 +386,7 @@ onMounted(() => {
|
||||
<div class="bg-neutral-800/50 border border-neutral-700 rounded-lg p-4 flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm text-neutral-400 mb-1">One-time purchase</p>
|
||||
<p class="text-2xl font-bold text-oxide-400">${{ selectedModule.price.toFixed(2) }}</p>
|
||||
<p class="text-2xl font-bold text-oxide-400">${{ safeFixed(selectedModule.price, 2) }}</p>
|
||||
</div>
|
||||
<button
|
||||
v-if="!selectedModule.is_purchased"
|
||||
@@ -436,7 +437,7 @@ onMounted(() => {
|
||||
</div>
|
||||
<div class="border-t border-neutral-700 pt-2 mt-2 flex items-center justify-between">
|
||||
<span class="text-base font-medium text-neutral-300">Total</span>
|
||||
<span class="text-2xl font-bold text-oxide-400">${{ selectedModule.price.toFixed(2) }}</span>
|
||||
<span class="text-2xl font-bold text-oxide-400">${{ safeFixed(selectedModule.price, 2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user