forked from jsnbuchanan/crowd-funder-for-time-pwa
refactor: improve router type safety and usage
- Add explicit Router type imports across views - Replace $router type casting with proper typing - Use $router.back() instead of $router.go(-1) for consistency - Add proper route and router typings to components - Clean up router navigation methods - Fix router push/back method calls This commit improves type safety and consistency in router usage across the application's view components.
This commit is contained in:
@@ -59,7 +59,10 @@
|
||||
<div class="font-bold">
|
||||
{{ displayAmount(record.unit, record.amount) }}
|
||||
<span v-if="record.amountConfirmed" title="Confirmed">
|
||||
<font-awesome icon="circle-check" class="text-green-600 fa-fw" />
|
||||
<font-awesome
|
||||
icon="circle-check"
|
||||
class="text-green-600 fa-fw"
|
||||
/>
|
||||
</span>
|
||||
<button v-else @click="confirm(record)" title="Unconfirmed">
|
||||
<font-awesome icon="circle" class="text-blue-600 fa-fw" />
|
||||
@@ -83,7 +86,10 @@
|
||||
<div class="font-bold">
|
||||
{{ displayAmount(record.unit, record.amount) }}
|
||||
<span v-if="record.amountConfirmed" title="Confirmed">
|
||||
<font-awesome icon="circle-check" class="text-green-600 fa-fw" />
|
||||
<font-awesome
|
||||
icon="circle-check"
|
||||
class="text-green-600 fa-fw"
|
||||
/>
|
||||
</span>
|
||||
<button
|
||||
v-else
|
||||
@@ -108,7 +114,7 @@
|
||||
import { AxiosError, AxiosRequestHeaders } from "axios";
|
||||
import * as R from "ramda";
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { Router } from "vue-router";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
import { NotificationIface } from "../constants/app";
|
||||
@@ -116,11 +122,13 @@ import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||
import { Contact } from "../db/tables/contacts";
|
||||
import {
|
||||
AgreeVerifiableCredential,
|
||||
GiveSummaryRecord,
|
||||
GiveVerifiableCredential,
|
||||
} from "../interfaces";
|
||||
import {
|
||||
createEndorserJwtVcFromClaim,
|
||||
displayAmount,
|
||||
getHeaders,
|
||||
GiveSummaryRecord,
|
||||
GiveVerifiableCredential,
|
||||
SCHEMA_ORG_CONTEXT,
|
||||
} from "../libs/endorserServer";
|
||||
import { retrieveAccountCount } from "../libs/util";
|
||||
@@ -128,6 +136,8 @@ import { retrieveAccountCount } from "../libs/util";
|
||||
@Component({ components: { QuickNav } })
|
||||
export default class ContactAmountssView extends Vue {
|
||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||
$route!: RouteLocationNormalizedLoaded;
|
||||
$router!: Router;
|
||||
|
||||
activeDid = "";
|
||||
apiServer = "";
|
||||
@@ -143,7 +153,7 @@ export default class ContactAmountssView extends Vue {
|
||||
|
||||
async created() {
|
||||
try {
|
||||
const contactDid = (this.$route as Router).query["contactDid"] as string;
|
||||
const contactDid = this.$route.query["contactDid"] as string;
|
||||
this.contact = (await db.contacts.get(contactDid)) || null;
|
||||
|
||||
const settings = await retrieveSettingsForActiveAccount();
|
||||
|
||||
Reference in New Issue
Block a user