fix: improve DeepLinkErrorView code quality

- Fix TypeScript property error by using validRoutes constant
- Replace console.log with logger utility
- Fix string quote consistency
- Improve v-for loop variable naming
- Add proper type safety for route parameters

Technical Changes:
- Use VALID_DEEP_LINK_ROUTES constant for route list
- Add logger import and replace console.log calls
- Standardize string quotes to double quotes
- Rename v-for variable to avoid shadowing
- Add proper type assertions for route params

This improves code quality and type safety in the
DeepLinkErrorView component while maintaining consistent
coding standards.
This commit is contained in:
Matthew Raymer
2025-03-20 12:04:27 +00:00
parent 4b7a618ab6
commit acb003c6b3
5 changed files with 31 additions and 29 deletions

View File

@@ -30,8 +30,8 @@
<div class="supported-links">
<h2>Supported Deep Links</h2>
<ul>
<li v-for="route in validRoutes" :key="route">
<code>timesafari://{{ route }}/:id</code>
<li v-for="(routeItem, index) in validRoutes" :key="index">
<code>timesafari://{{ routeItem }}/:id</code>
</li>
</ul>
</div>
@@ -43,6 +43,7 @@ import { computed, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { VALID_DEEP_LINK_ROUTES } from "../types/deepLinks";
import { logConsoleAndDb } from "../db";
import { logger } from "../utils/logger";
const route = useRoute();
const router = useRouter();
@@ -61,14 +62,14 @@ const validRoutes = VALID_DEEP_LINK_ROUTES;
// Format the path and include any parameters
const formattedPath = computed(() => {
if (!originalPath.value) return '';
let path = originalPath.value.replace(/^\/+/, '');
if (!originalPath.value) return "";
const path = originalPath.value.replace(/^\/+/, "");
// Log for debugging
console.log('Original Path:', originalPath.value);
console.log('Route Params:', route.params);
console.log('Route Query:', route.query);
logger.log("Original Path:", originalPath.value);
logger.log("Route Params:", route.params);
logger.log("Route Query:", route.query);
return path;
});
@@ -111,7 +112,8 @@ h1 {
margin-bottom: 24px;
}
h2, h3 {
h2,
h3 {
color: #333;
margin-bottom: 12px;
}