forked from trent_larson/crowd-funder-for-time-pwa
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:
@@ -1,7 +1,7 @@
|
|||||||
import type { CapacitorConfig } from '@capacitor/cli';
|
import type { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
const config: CapacitorConfig = {
|
const config: CapacitorConfig = {
|
||||||
appId: 'app.timesafari.app',
|
appId: 'timesafari.app',
|
||||||
appName: 'TimeSafari',
|
appName: 'TimeSafari',
|
||||||
webDir: 'dist',
|
webDir: 'dist',
|
||||||
bundledWebRuntime: false,
|
bundledWebRuntime: false,
|
||||||
|
|||||||
28
package-lock.json
generated
28
package-lock.json
generated
@@ -8144,9 +8144,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@react-native/metro-babel-transformer/node_modules/jscodeshift": {
|
"node_modules/@react-native/metro-babel-transformer/node_modules/jscodeshift": {
|
||||||
"version": "17.1.2",
|
"version": "17.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-17.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-17.2.0.tgz",
|
||||||
"integrity": "sha512-uime4vFOiZ1o3ICT4Sm/AbItHEVw2oCxQ3a0egYVy3JMMOctxe07H3SKL1v175YqjMt27jn1N+3+Bj9SKDNgdQ==",
|
"integrity": "sha512-ZQeKdRmrUhk3vmESbWCUch6BQIngO6Sx6mgLJsR8QD9kqY0xyN9J8Vzkee4tULjekBnV9SiKf9m8ybNURh9s+g==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
@@ -8166,7 +8166,7 @@
|
|||||||
"micromatch": "^4.0.7",
|
"micromatch": "^4.0.7",
|
||||||
"neo-async": "^2.5.0",
|
"neo-async": "^2.5.0",
|
||||||
"picocolors": "^1.0.1",
|
"picocolors": "^1.0.1",
|
||||||
"recast": "^0.23.9",
|
"recast": "^0.23.10",
|
||||||
"tmp": "^0.2.3",
|
"tmp": "^0.2.3",
|
||||||
"write-file-atomic": "^5.0.1"
|
"write-file-atomic": "^5.0.1"
|
||||||
},
|
},
|
||||||
@@ -14384,9 +14384,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "33.4.5",
|
"version": "33.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-33.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-33.4.6.tgz",
|
||||||
"integrity": "sha512-rbDc4QOqfMT1uopUG+KcaMKzKgFAXAzN3wNIdgErnB1tUnpgTxwFv1BDN/exCl1vaVWBeM9YtbO5PgbGZeq7xw==",
|
"integrity": "sha512-INNAYGkMWOb10FNMHaSdow0ekFiftFznpn6Cqo/vEgEapBMyNzGJa+0IVCezmgyRUW08FCHd+ngjvynALSndxQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -14515,9 +14515,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.5.121",
|
"version": "1.5.122",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.121.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.122.tgz",
|
||||||
"integrity": "sha512-gpIEzIb3uvm6V8IK452TvzOvZ3EAF8D5i11SMUG7BjpF2aalh5KyKX5dO+GDW5m9Qdia1ejLm6WM5NOIOd7sbQ==",
|
"integrity": "sha512-EML1wnwkY5MFh/xUnCvY8FrhUuKzdYhowuZExZOfwJo+Zu9OsNCI23Cgl5y7awy7HrUHSwB1Z8pZX5TI34lsUg==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
@@ -23743,9 +23743,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-native/node_modules/jscodeshift": {
|
"node_modules/react-native/node_modules/jscodeshift": {
|
||||||
"version": "17.1.2",
|
"version": "17.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-17.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-17.2.0.tgz",
|
||||||
"integrity": "sha512-uime4vFOiZ1o3ICT4Sm/AbItHEVw2oCxQ3a0egYVy3JMMOctxe07H3SKL1v175YqjMt27jn1N+3+Bj9SKDNgdQ==",
|
"integrity": "sha512-ZQeKdRmrUhk3vmESbWCUch6BQIngO6Sx6mgLJsR8QD9kqY0xyN9J8Vzkee4tULjekBnV9SiKf9m8ybNURh9s+g==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
@@ -23765,7 +23765,7 @@
|
|||||||
"micromatch": "^4.0.7",
|
"micromatch": "^4.0.7",
|
||||||
"neo-async": "^2.5.0",
|
"neo-async": "^2.5.0",
|
||||||
"picocolors": "^1.0.1",
|
"picocolors": "^1.0.1",
|
||||||
"recast": "^0.23.9",
|
"recast": "^0.23.10",
|
||||||
"tmp": "^0.2.3",
|
"tmp": "^0.2.3",
|
||||||
"write-file-atomic": "^5.0.1"
|
"write-file-atomic": "^5.0.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ export class DeepLinkHandler {
|
|||||||
"invite-one-accept": "invite-one-accept",
|
"invite-one-accept": "invite-one-accept",
|
||||||
"contact-import": "contact-import",
|
"contact-import": "contact-import",
|
||||||
"confirm-gift": "confirm-gift",
|
"confirm-gift": "confirm-gift",
|
||||||
"claim": "claim",
|
claim: "claim",
|
||||||
"claim-cert": "claim-cert",
|
"claim-cert": "claim-cert",
|
||||||
"claim-add-raw": "claim-add-raw",
|
"claim-add-raw": "claim-add-raw",
|
||||||
"contact-edit": "contact-edit",
|
"contact-edit": "contact-edit",
|
||||||
"contacts": "contacts",
|
contacts: "contacts",
|
||||||
"did": "did",
|
did: "did",
|
||||||
};
|
};
|
||||||
|
|
||||||
// First try to validate the route path
|
// First try to validate the route path
|
||||||
|
|||||||
@@ -829,7 +829,7 @@ export default class ConfirmGiftView extends Vue {
|
|||||||
3000,
|
3000,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.error("Got error submitting the confirmation:", result);
|
logger.error("Got error submitting the confirmation:", result);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
<div class="supported-links">
|
<div class="supported-links">
|
||||||
<h2>Supported Deep Links</h2>
|
<h2>Supported Deep Links</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="route in validRoutes" :key="route">
|
<li v-for="(routeItem, index) in validRoutes" :key="index">
|
||||||
<code>timesafari://{{ route }}/:id</code>
|
<code>timesafari://{{ routeItem }}/:id</code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,6 +43,7 @@ import { computed, onMounted } from "vue";
|
|||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { VALID_DEEP_LINK_ROUTES } from "../types/deepLinks";
|
import { VALID_DEEP_LINK_ROUTES } from "../types/deepLinks";
|
||||||
import { logConsoleAndDb } from "../db";
|
import { logConsoleAndDb } from "../db";
|
||||||
|
import { logger } from "../utils/logger";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -61,14 +62,14 @@ const validRoutes = VALID_DEEP_LINK_ROUTES;
|
|||||||
|
|
||||||
// Format the path and include any parameters
|
// Format the path and include any parameters
|
||||||
const formattedPath = computed(() => {
|
const formattedPath = computed(() => {
|
||||||
if (!originalPath.value) return '';
|
if (!originalPath.value) return "";
|
||||||
let path = originalPath.value.replace(/^\/+/, '');
|
const path = originalPath.value.replace(/^\/+/, "");
|
||||||
|
|
||||||
// Log for debugging
|
// Log for debugging
|
||||||
console.log('Original Path:', originalPath.value);
|
logger.log("Original Path:", originalPath.value);
|
||||||
console.log('Route Params:', route.params);
|
logger.log("Route Params:", route.params);
|
||||||
console.log('Route Query:', route.query);
|
logger.log("Route Query:", route.query);
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -111,7 +112,8 @@ h1 {
|
|||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2, h3 {
|
h2,
|
||||||
|
h3 {
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user