Browse Source

fix linting

pull/127/head
Trent Larson 2 days ago
parent
commit
d53de5e79b
  1. 8
      src/services/deepLinks.ts
  2. 30
      src/types/deepLinks.ts
  3. 12
      src/views/ClaimAddRawView.vue
  4. 60
      src/views/ConfirmGiftView.vue
  5. 36
      src/views/DIDView.vue
  6. 31
      src/views/HomeView.vue

8
src/services/deepLinks.ts

@ -111,17 +111,17 @@ export class DeepLinkHandler {
): Promise<void> { ): Promise<void> {
const routeMap: Record<string, string> = { const routeMap: Record<string, string> = {
"user-profile": "user-profile", "user-profile": "user-profile",
"project": "project", project: "project",
"onboard-meeting-setup": "onboard-meeting-setup", "onboard-meeting-setup": "onboard-meeting-setup",
"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",
}; };
const routeName = routeMap[path]; const routeName = routeMap[path];

30
src/types/deepLinks.ts

@ -37,43 +37,43 @@ export const baseUrlSchema = z.object({
// Parameter validation schemas for each route type // Parameter validation schemas for each route type
export const deepLinkSchemas = { export const deepLinkSchemas = {
"user-profile": z.object({ "user-profile": z.object({
id: z.string() id: z.string(),
}), }),
"project-details": z.object({ "project-details": z.object({
id: z.string() id: z.string(),
}), }),
"onboard-meeting-setup": z.object({ "onboard-meeting-setup": z.object({
id: z.string() id: z.string(),
}), }),
"invite-one-accept": z.object({ "invite-one-accept": z.object({
id: z.string() id: z.string(),
}), }),
"contact-import": z.object({ "contact-import": z.object({
jwt: z.string() jwt: z.string(),
}), }),
"confirm-gift": z.object({ "confirm-gift": z.object({
id: z.string() id: z.string(),
}), }),
"claim": z.object({ claim: z.object({
id: z.string() id: z.string(),
}), }),
"claim-cert": z.object({ "claim-cert": z.object({
id: z.string() id: z.string(),
}), }),
"claim-add-raw": z.object({ "claim-add-raw": z.object({
id: z.string(), id: z.string(),
claim: z.string().optional(), claim: z.string().optional(),
claimJwtId: z.string().optional() claimJwtId: z.string().optional(),
}), }),
"contact-edit": z.object({ "contact-edit": z.object({
did: z.string() did: z.string(),
}), }),
"contacts": z.object({ contacts: z.object({
contacts: z.string() // JSON string of contacts array contacts: z.string(), // JSON string of contacts array
}), }),
did: z.object({ did: z.object({
id: z.string() id: z.string(),
}) }),
}; };
export type DeepLinkParams = { export type DeepLinkParams = {

12
src/views/ClaimAddRawView.vue

@ -52,7 +52,7 @@ export default class ClaimAddRawView extends Vue {
$route!: RouteLocationNormalizedLoaded; $route!: RouteLocationNormalizedLoaded;
$router!: Router; $router!: Router;
axios!: AxiosInstance; axios!: AxiosInstance;
accountIdentityStr: string = "null"; accountIdentityStr: string = "null";
activeDid = ""; activeDid = "";
apiServer = ""; apiServer = "";
@ -87,7 +87,7 @@ export default class ClaimAddRawView extends Vue {
private async loadClaimData() { private async loadClaimData() {
// Try loading from direct claim parameter // Try loading from direct claim parameter
if (await this.loadClaimFromQueryParam()) return; if (await this.loadClaimFromQueryParam()) return;
// Try loading from claim JWT ID // Try loading from claim JWT ID
await this.loadClaimFromJwtId(); await this.loadClaimFromJwtId();
} }
@ -121,9 +121,9 @@ export default class ClaimAddRawView extends Vue {
? "/api/claim/byHandle/" ? "/api/claim/byHandle/"
: "/api/claim/"; : "/api/claim/";
const url = this.apiServer + urlPath + encodeURIComponent(claimJwtId); const url = this.apiServer + urlPath + encodeURIComponent(claimJwtId);
try { try {
const response = await this.fetchClaimData(url, claimJwtId); const response = await this.fetchClaimData(url);
this.formatClaimResponse(response, claimJwtId); this.formatClaimResponse(response, claimJwtId);
} catch (error: unknown) { } catch (error: unknown) {
this.handleClaimError(error); this.handleClaimError(error);
@ -133,7 +133,7 @@ export default class ClaimAddRawView extends Vue {
/** /**
* Fetch claim data from API * Fetch claim data from API
*/ */
private async fetchClaimData(url: string, claimJwtId: string) { private async fetchClaimData(url: string) {
const headers = await serverUtil.getHeaders(this.activeDid); const headers = await serverUtil.getHeaders(this.activeDid);
return await this.axios.get(url, { headers }); return await this.axios.get(url, { headers });
} }
@ -169,7 +169,7 @@ export default class ClaimAddRawView extends Vue {
{ {
group: "alert", group: "alert",
type: "danger", type: "danger",
title: "Error", title: "Error",
text: "Got an error retrieving claim data.", text: "Got an error retrieving claim data.",
}, },
3000, 3000,

60
src/views/ConfirmGiftView.vue

@ -430,13 +430,11 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { AxiosError } from "axios";
import * as yaml from "js-yaml"; import * as yaml from "js-yaml";
import * as R from "ramda"; import * as R from "ramda";
import { Component, Vue } from "vue-facing-decorator"; import { Component, Vue } from "vue-facing-decorator";
import { useClipboard } from "@vueuse/core"; import { useClipboard } from "@vueuse/core";
import { RouteLocationNormalizedLoaded, Router } from "vue-router"; import { RouteLocationNormalizedLoaded, Router } from "vue-router";
import { GenericVerifiableCredential } from "../interfaces";
import QuickNav from "../components/QuickNav.vue"; import QuickNav from "../components/QuickNav.vue";
import { NotificationIface } from "../constants/app"; import { NotificationIface } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index"; import { db, retrieveSettingsForActiveAccount } from "../db/index";
@ -445,16 +443,16 @@ import * as serverUtil from "../libs/endorserServer";
import { GiveSummaryRecord } from "../interfaces"; import { GiveSummaryRecord } from "../interfaces";
import { displayAmount } from "../libs/endorserServer"; import { displayAmount } from "../libs/endorserServer";
import * as libsUtil from "../libs/util"; import * as libsUtil from "../libs/util";
import { isGiveAction, retrieveAccountDids } from "../libs/util"; import { retrieveAccountDids } from "../libs/util";
import TopMessage from "../components/TopMessage.vue"; import TopMessage from "../components/TopMessage.vue";
/** /**
* ConfirmGiftView Component * ConfirmGiftView Component
* *
* Displays details about a gift claim and allows users to confirm it if eligible. * Displays details about a gift claim and allows users to confirm it if eligible.
* Shows gift details including giver, recipient, amount, description, and confirmation status. * Shows gift details including giver, recipient, amount, description, and confirmation status.
* Handles visibility of hidden DIDs and provides access to detailed claim information. * Handles visibility of hidden DIDs and provides access to detailed claim information.
* *
* Key features: * Key features:
* - Gift confirmation workflow * - Gift confirmation workflow
* - Detailed gift information display * - Detailed gift information display
@ -504,7 +502,7 @@ export default class ConfirmGiftView extends Vue {
/** /**
* Initializes the view with gift claim information * Initializes the view with gift claim information
* *
* Workflow: * Workflow:
* 1. Retrieves active account settings * 1. Retrieves active account settings
* 2. Loads gift claim details from ID in URL * 2. Loads gift claim details from ID in URL
@ -534,7 +532,7 @@ export default class ConfirmGiftView extends Vue {
this.allContacts = await db.contacts.toArray(); this.allContacts = await db.contacts.toArray();
this.isRegistered = settings.isRegistered || false; this.isRegistered = settings.isRegistered || false;
this.allMyDids = await retrieveAccountDids(); this.allMyDids = await retrieveAccountDids();
// Check share capability // Check share capability
// When Chrome compatibility is fixed https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API#api.navigator.canshare // When Chrome compatibility is fixed https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API#api.navigator.canshare
// then use this truer check: navigator.canShare && navigator.canShare() // then use this truer check: navigator.canShare && navigator.canShare()
@ -545,7 +543,9 @@ export default class ConfirmGiftView extends Vue {
* Loads and processes claim from URL parameters * Loads and processes claim from URL parameters
*/ */
private async loadClaimFromUrl() { private async loadClaimFromUrl() {
const pathParam = window.location.pathname.substring("/confirm-gift/".length); const pathParam = window.location.pathname.substring(
"/confirm-gift/".length,
);
if (!pathParam) { if (!pathParam) {
throw new Error("No claim ID was provided."); throw new Error("No claim ID was provided.");
} }
@ -563,7 +563,8 @@ export default class ConfirmGiftView extends Vue {
group: "alert", group: "alert",
type: "danger", type: "danger",
title: "Error", title: "Error",
text: error instanceof Error ? error.message : "No claim ID was provided.", text:
error instanceof Error ? error.message : "No claim ID was provided.",
}, },
3000, 3000,
); );
@ -571,7 +572,7 @@ export default class ConfirmGiftView extends Vue {
/** /**
* Loads claim details and associated give information * Loads claim details and associated give information
* *
* @param claimId - ID of claim to load * @param claimId - ID of claim to load
* @param userDid - User's DID * @param userDid - User's DID
*/ */
@ -596,7 +597,7 @@ export default class ConfirmGiftView extends Vue {
try { try {
const headers = await serverUtil.getHeaders(userDid); const headers = await serverUtil.getHeaders(userDid);
const resp = await this.axios.get(url, { headers }); const resp = await this.axios.get(url, { headers });
if (resp.status === 200) { if (resp.status === 200) {
this.veriClaim = resp.data; this.veriClaim = resp.data;
this.veriClaimDump = yaml.dump(this.veriClaim); this.veriClaimDump = yaml.dump(this.veriClaim);
@ -619,11 +620,11 @@ export default class ConfirmGiftView extends Vue {
*/ */
private async fetchGiveDetails(claimId: string, userDid: string) { private async fetchGiveDetails(claimId: string, userDid: string) {
const giveUrl = `${this.apiServer}/api/v2/report/gives?handleId=${encodeURIComponent(claimId)}`; const giveUrl = `${this.apiServer}/api/v2/report/gives?handleId=${encodeURIComponent(claimId)}`;
try { try {
const headers = await serverUtil.getHeaders(userDid); const headers = await serverUtil.getHeaders(userDid);
const resp = await this.axios.get(giveUrl, { headers }); const resp = await this.axios.get(giveUrl, { headers });
if (resp.status === 200) { if (resp.status === 200) {
this.giveDetails = resp.data.data[0]; this.giveDetails = resp.data.data[0];
} else { } else {
@ -683,7 +684,10 @@ export default class ConfirmGiftView extends Vue {
if (this.giveDetails?.fullClaim.image) { if (this.giveDetails?.fullClaim.image) {
this.urlForNewGive += `&image=${encodeURIComponent(this.giveDetails.fullClaim.image)}`; this.urlForNewGive += `&image=${encodeURIComponent(this.giveDetails.fullClaim.image)}`;
} }
if (this.giveDetails?.type === "Offer" && this.giveDetails?.fulfillsHandleId) { if (
this.giveDetails?.type === "Offer" &&
this.giveDetails?.fulfillsHandleId
) {
this.urlForNewGive += `&offerId=${encodeURIComponent(this.giveDetails.fulfillsHandleId)}`; this.urlForNewGive += `&offerId=${encodeURIComponent(this.giveDetails.fulfillsHandleId)}`;
} }
if (this.giveDetails?.fulfillsPlanHandleId) { if (this.giveDetails?.fulfillsPlanHandleId) {
@ -701,7 +705,7 @@ export default class ConfirmGiftView extends Vue {
this.veriClaim.issuer, this.veriClaim.issuer,
userDid, userDid,
); );
if (confirmerInfo) { if (confirmerInfo) {
this.confirmerIdList = confirmerInfo.confirmerIdList; this.confirmerIdList = confirmerInfo.confirmerIdList;
this.confsVisibleToIdList = confirmerInfo.confsVisibleToIdList; this.confsVisibleToIdList = confirmerInfo.confsVisibleToIdList;
@ -714,7 +718,7 @@ export default class ConfirmGiftView extends Vue {
/** /**
* Calculates total number of confirmers for the gift * Calculates total number of confirmers for the gift
* Includes both direct confirmers and those visible through network * Includes both direct confirmers and those visible through network
* *
* @returns Total number of confirmers * @returns Total number of confirmers
*/ */
totalConfirmers(): number { totalConfirmers(): number {
@ -725,21 +729,10 @@ export default class ConfirmGiftView extends Vue {
); );
} }
/**
* Formats display amount with proper unit
*
* @param unit - Currency or unit code
* @param amount - Numeric amount
* @returns Formatted amount string
*/
displayAmount(unit: string, amount: number): string {
return displayAmount(unit, amount);
}
/** /**
* Retrieves human-readable name for a DID * Retrieves human-readable name for a DID
* Falls back to DID if no name available * Falls back to DID if no name available
* *
* @param did - DID to get name for * @param did - DID to get name for
* @returns Human-readable name * @returns Human-readable name
*/ */
@ -754,7 +747,7 @@ export default class ConfirmGiftView extends Vue {
/** /**
* Copies text to clipboard and shows notification * Copies text to clipboard and shows notification
* *
* @param description - Description of copied content * @param description - Description of copied content
* @param text - Text to copy * @param text - Text to copy
*/ */
@ -776,7 +769,7 @@ export default class ConfirmGiftView extends Vue {
/** /**
* Navigates to claim page for detailed view * Navigates to claim page for detailed view
* *
* @param claimId - ID of claim to view * @param claimId - ID of claim to view
*/ */
showClaimPage(claimId: string): void { showClaimPage(claimId: string): void {
@ -826,15 +819,12 @@ export default class ConfirmGiftView extends Vue {
/** /**
* Formats type string for display by adding spaces before capitals * Formats type string for display by adding spaces before capitals
* Optionally adds a prefix * Optionally adds a prefix
* *
* @param text - Text to format * @param text - Text to format
* @param prefix - Optional prefix to add * @param prefix - Optional prefix to add
* @returns Formatted string * @returns Formatted string
*/ */
capitalizeAndInsertSpacesBeforeCapsWithAPrefix( capitalizeAndInsertSpacesBeforeCapsWithAPrefix(text: string): string {
text: string,
prefix?: string
): string {
const word = this.capitalizeAndInsertSpacesBeforeCaps(text); const word = this.capitalizeAndInsertSpacesBeforeCaps(text);
if (word) { if (word) {
// if the word starts with a vowel, use "an" instead of "a" // if the word starts with a vowel, use "an" instead of "a"

36
src/views/DIDView.vue

@ -255,12 +255,12 @@ import EntityIcon from "../components/EntityIcon.vue";
/** /**
* DIDView Component * DIDView Component
* *
* Displays detailed information about a DID (Decentralized Identifier) entity, including: * Displays detailed information about a DID (Decentralized Identifier) entity, including:
* - Basic identity information (name, profile image) * - Basic identity information (name, profile image)
* - Contact management controls (visibility, registration status) * - Contact management controls (visibility, registration status)
* - Associated claims and their details * - Associated claims and their details
* *
* The view supports both viewing one's own DID and other contacts' DIDs. * The view supports both viewing one's own DID and other contacts' DIDs.
* It provides infinite scrolling for claims and interactive controls for contact management. * It provides infinite scrolling for claims and interactive controls for contact management.
*/ */
@ -300,7 +300,7 @@ export default class DIDView extends Vue {
/** /**
* Initializes the view with DID information * Initializes the view with DID information
* *
* Workflow: * Workflow:
* 1. Retrieves active account settings (DID and API server) * 1. Retrieves active account settings (DID and API server)
* 2. Determines which DID to display from URL params or defaults to active DID * 2. Determines which DID to display from URL params or defaults to active DID
@ -334,14 +334,14 @@ export default class DIDView extends Vue {
private async determineDIDToDisplay() { private async determineDIDToDisplay() {
const pathParam = window.location.pathname.substring("/did/".length); const pathParam = window.location.pathname.substring("/did/".length);
let showDid = pathParam; let showDid = pathParam;
if (!showDid) { if (!showDid) {
showDid = this.activeDid; showDid = this.activeDid;
if (showDid) { if (showDid) {
this.notifyDefaultToActiveDID(); this.notifyDefaultToActiveDID();
} }
} }
if (showDid) { if (showDid) {
this.viewingDid = decodeURIComponent(showDid); this.viewingDid = decodeURIComponent(showDid);
} }
@ -368,7 +368,7 @@ export default class DIDView extends Vue {
*/ */
private async loadContactInformation() { private async loadContactInformation() {
if (!this.viewingDid) return; if (!this.viewingDid) return;
this.contactFromDid = await db.contacts.get(this.viewingDid); this.contactFromDid = await db.contacts.get(this.viewingDid);
if (this.contactFromDid) { if (this.contactFromDid) {
this.contactYaml = yaml.dump(this.contactFromDid); this.contactYaml = yaml.dump(this.contactFromDid);
@ -380,7 +380,7 @@ export default class DIDView extends Vue {
*/ */
private async checkIfOwnDID() { private async checkIfOwnDID() {
if (!this.viewingDid) return; if (!this.viewingDid) return;
const allAccountDids = await libsUtil.retrieveAccountDids(); const allAccountDids = await libsUtil.retrieveAccountDids();
this.isMyDid = allAccountDids.includes(this.viewingDid); this.isMyDid = allAccountDids.includes(this.viewingDid);
} }
@ -388,7 +388,7 @@ export default class DIDView extends Vue {
/** /**
* Loads additional claims when user scrolls to bottom * Loads additional claims when user scrolls to bottom
* Used by infinite scroll component to implement pagination * Used by infinite scroll component to implement pagination
* *
* @param payload - Boolean indicating if more data should be loaded * @param payload - Boolean indicating if more data should be loaded
*/ */
async loadMoreData(payload: boolean) { async loadMoreData(payload: boolean) {
@ -400,7 +400,7 @@ export default class DIDView extends Vue {
/** /**
* Prompts user to confirm contact deletion * Prompts user to confirm contact deletion
* Shows additional warning if contact has visibility permissions * Shows additional warning if contact has visibility permissions
* *
* @param contact - Contact object to be deleted * @param contact - Contact object to be deleted
*/ */
confirmDeleteContact(contact: Contact) { confirmDeleteContact(contact: Contact) {
@ -428,7 +428,7 @@ export default class DIDView extends Vue {
/** /**
* Deletes contact from local database and navigates back to contacts list * Deletes contact from local database and navigates back to contacts list
* *
* @param contact - Contact object to be deleted * @param contact - Contact object to be deleted
*/ */
async deleteContact(contact: Contact) { async deleteContact(contact: Contact) {
@ -449,7 +449,7 @@ export default class DIDView extends Vue {
/** /**
* Prompts user to confirm registering a contact * Prompts user to confirm registering a contact
* Shows additional warning if contact is already registered * Shows additional warning if contact is already registered
* *
* @param contact - Contact to be registered * @param contact - Contact to be registered
*/ */
async confirmRegister(contact: Contact) { async confirmRegister(contact: Contact) {
@ -476,7 +476,7 @@ export default class DIDView extends Vue {
/** /**
* Registers a contact with the endorser server * Registers a contact with the endorser server
* Updates local database with registration status * Updates local database with registration status
* *
* @param contact - Contact to register * @param contact - Contact to register
*/ */
async register(contact: Contact) { async register(contact: Contact) {
@ -609,7 +609,7 @@ export default class DIDView extends Vue {
/** /**
* Navigates to detailed claim view * Navigates to detailed claim view
* *
* @param jwtId - JWT ID of the claim to view * @param jwtId - JWT ID of the claim to view
*/ */
onClickLoadClaim(jwtId: string) { onClickLoadClaim(jwtId: string) {
@ -622,7 +622,7 @@ export default class DIDView extends Vue {
/** /**
* Extracts and formats claim amount information * Extracts and formats claim amount information
* Handles different claim types (GiveAction, Offer) * Handles different claim types (GiveAction, Offer)
* *
* @param claim - Claim object to process * @param claim - Claim object to process
* @returns Formatted amount string or empty string if no amount * @returns Formatted amount string or empty string if no amount
*/ */
@ -657,7 +657,7 @@ export default class DIDView extends Vue {
/** /**
* Extracts claim description * Extracts claim description
* Falls back to name if no description available * Falls back to name if no description available
* *
* @param claim - Claim to get description from * @param claim - Claim to get description from
* @returns Description string or empty string * @returns Description string or empty string
*/ */
@ -667,7 +667,7 @@ export default class DIDView extends Vue {
/** /**
* Prompts user to confirm visibility change for a contact * Prompts user to confirm visibility change for a contact
* *
* @param contact - Contact to modify visibility for * @param contact - Contact to modify visibility for
* @param visibility - New visibility state to set * @param visibility - New visibility state to set
*/ */
@ -694,7 +694,7 @@ export default class DIDView extends Vue {
/** /**
* Updates contact visibility on server and local database * Updates contact visibility on server and local database
* *
* @param contact - Contact to update visibility for * @param contact - Contact to update visibility for
* @param visibility - New visibility state * @param visibility - New visibility state
* @param showSuccessAlert - Whether to show success notification * @param showSuccessAlert - Whether to show success notification
@ -752,7 +752,7 @@ export default class DIDView extends Vue {
/** /**
* Checks current visibility status of contact on server * Checks current visibility status of contact on server
* Updates local database with current status * Updates local database with current status
* *
* @param contact - Contact to check visibility for * @param contact - Contact to check visibility for
*/ */
async checkVisibility(contact: Contact) { async checkVisibility(contact: Contact) {

31
src/views/HomeView.vue

@ -429,9 +429,8 @@ import {
retrieveAccountDids, retrieveAccountDids,
GiverReceiverInputInfo, GiverReceiverInputInfo,
OnboardPage, OnboardPage,
registerSaveAndActivatePasskey,
} from "../libs/util"; } from "../libs/util";
import { GiveSummaryRecord} from "../interfaces"; import { GiveSummaryRecord } from "../interfaces";
interface GiveRecordWithContactInfo extends GiveSummaryRecord { interface GiveRecordWithContactInfo extends GiveSummaryRecord {
jwtId: string; jwtId: string;
giver: { giver: {
@ -451,7 +450,7 @@ interface GiveRecordWithContactInfo extends GiveSummaryRecord {
/** /**
* HomeView - Main view component for the application's home page * HomeView - Main view component for the application's home page
* *
* Workflow: * Workflow:
* 1. On mount, initializes user identity, settings, and data * 1. On mount, initializes user identity, settings, and data
* 2. Handles user registration status * 2. Handles user registration status
@ -552,7 +551,10 @@ export default class HomeView extends Vue {
this.allMyDids = [newDid]; this.allMyDids = [newDid];
} }
} catch (error) { } catch (error) {
logConsoleAndDb("Error retrieving all account DIDs on home page:" + error, true); logConsoleAndDb(
"Error retrieving all account DIDs on home page:" + error,
true,
);
} }
} }
@ -575,7 +577,8 @@ export default class HomeView extends Vue {
this.isFeedFilteredByNearby = !!settings.filterFeedByNearby; this.isFeedFilteredByNearby = !!settings.filterFeedByNearby;
this.isRegistered = !!settings.isRegistered; this.isRegistered = !!settings.isRegistered;
this.lastAckedOfferToUserJwtId = settings.lastAckedOfferToUserJwtId; this.lastAckedOfferToUserJwtId = settings.lastAckedOfferToUserJwtId;
this.lastAckedOfferToUserProjectsJwtId = settings.lastAckedOfferToUserProjectsJwtId; this.lastAckedOfferToUserProjectsJwtId =
settings.lastAckedOfferToUserProjectsJwtId;
this.searchBoxes = settings.searchBoxes || []; this.searchBoxes = settings.searchBoxes || [];
this.showShortcutBvc = !!settings.showShortcutBvc; this.showShortcutBvc = !!settings.showShortcutBvc;
this.isAnyFeedFilterOn = checkIsAnyFeedFilterOn(settings); this.isAnyFeedFilterOn = checkIsAnyFeedFilterOn(settings);
@ -598,12 +601,16 @@ export default class HomeView extends Vue {
private async checkRegistrationStatus() { private async checkRegistrationStatus() {
if (!this.isRegistered && this.activeDid) { if (!this.isRegistered && this.activeDid) {
try { try {
const resp = await fetchEndorserRateLimits(this.apiServer, this.axios, this.activeDid); const resp = await fetchEndorserRateLimits(
this.apiServer,
this.axios,
this.activeDid,
);
if (resp.status === 200) { if (resp.status === 200) {
await updateAccountSettings(this.activeDid, { await updateAccountSettings(this.activeDid, {
apiServer: this.apiServer, apiServer: this.apiServer,
isRegistered: true, isRegistered: true,
...await retrieveSettingsForActiveAccount() ...(await retrieveSettingsForActiveAccount()),
}); });
this.isRegistered = true; this.isRegistered = true;
} }
@ -635,7 +642,7 @@ export default class HomeView extends Vue {
this.axios, this.axios,
this.apiServer, this.apiServer,
this.activeDid, this.activeDid,
this.lastAckedOfferToUserJwtId this.lastAckedOfferToUserJwtId,
); );
this.numNewOffersToUser = offersToUserData.data.length; this.numNewOffersToUser = offersToUserData.data.length;
this.newOffersToUserHitLimit = offersToUserData.hitLimit; this.newOffersToUserHitLimit = offersToUserData.hitLimit;
@ -644,7 +651,7 @@ export default class HomeView extends Vue {
this.axios, this.axios,
this.apiServer, this.apiServer,
this.activeDid, this.activeDid,
this.lastAckedOfferToUserProjectsJwtId this.lastAckedOfferToUserProjectsJwtId,
); );
this.numNewOffersToUserProjects = offersToUserProjects.data.length; this.numNewOffersToUserProjects = offersToUserProjects.data.length;
this.newOffersToUserProjectsHitLimit = offersToUserProjects.hitLimit; this.newOffersToUserProjectsHitLimit = offersToUserProjects.hitLimit;
@ -675,9 +682,11 @@ export default class HomeView extends Vue {
group: "alert", group: "alert",
type: "danger", type: "danger",
title: "Error", title: "Error",
text: err.userMessage || "There was an error retrieving your settings or the latest activity.", text:
err.userMessage ||
"There was an error retrieving your settings or the latest activity.",
}, },
5000 5000,
); );
} }

Loading…
Cancel
Save