|  |  | @ -350,6 +350,47 @@ import * as serverUtil from "../libs/endorserServer"; | 
			
		
	
		
			
				
					|  |  |  | import { logger } from "../utils/logger"; | 
			
		
	
		
			
				
					|  |  |  | import { GiveRecordWithContactInfo } from "types"; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | interface Claim { | 
			
		
	
		
			
				
					|  |  |  |   claim?: Claim; // For nested claims in Verifiable Credentials | 
			
		
	
		
			
				
					|  |  |  |   agent?: { | 
			
		
	
		
			
				
					|  |  |  |     identifier?: string; | 
			
		
	
		
			
				
					|  |  |  |     did?: string; | 
			
		
	
		
			
				
					|  |  |  |   }; | 
			
		
	
		
			
				
					|  |  |  |   recipient?: { | 
			
		
	
		
			
				
					|  |  |  |     identifier?: string; | 
			
		
	
		
			
				
					|  |  |  |     did?: string; | 
			
		
	
		
			
				
					|  |  |  |   }; | 
			
		
	
		
			
				
					|  |  |  |   provider?: | 
			
		
	
		
			
				
					|  |  |  |     | { | 
			
		
	
		
			
				
					|  |  |  |         identifier?: string; | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |     | Array<{ identifier?: string }>; | 
			
		
	
		
			
				
					|  |  |  |   object?: { | 
			
		
	
		
			
				
					|  |  |  |     amountOfThisGood?: number; | 
			
		
	
		
			
				
					|  |  |  |     unitCode?: string; | 
			
		
	
		
			
				
					|  |  |  |   }; | 
			
		
	
		
			
				
					|  |  |  |   description?: string; | 
			
		
	
		
			
				
					|  |  |  |   image?: string; | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | interface FulfillsPlan { | 
			
		
	
		
			
				
					|  |  |  |   locLat?: number; | 
			
		
	
		
			
				
					|  |  |  |   locLon?: number; | 
			
		
	
		
			
				
					|  |  |  |   name?: string; | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | interface Provider { | 
			
		
	
		
			
				
					|  |  |  |   identifier?: string; | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | interface ProvidedByPlan { | 
			
		
	
		
			
				
					|  |  |  |   name?: string; | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | interface FeedError { | 
			
		
	
		
			
				
					|  |  |  |   userMessage?: string; | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | /** | 
			
		
	
		
			
				
					|  |  |  |  * HomeView Component | 
			
		
	
		
			
				
					|  |  |  |  * | 
			
		
	
	
		
			
				
					|  |  | @ -987,7 +1028,7 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    * @param claim The claim object containing giver information | 
			
		
	
		
			
				
					|  |  |  |    * @returns The giver's DID | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private extractGiverDid(claim: any) { | 
			
		
	
		
			
				
					|  |  |  |   private extractGiverDid(claim: Claim) { | 
			
		
	
		
			
				
					|  |  |  |     // eslint-disable-next-line @typescript-eslint/no-explicit-any | 
			
		
	
		
			
				
					|  |  |  |     return claim.agent?.identifier || (claim.agent as any)?.did; | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  | @ -998,7 +1039,7 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    * @internal | 
			
		
	
		
			
				
					|  |  |  |    * Called by processRecord() | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private extractRecipientDid(claim: any) { | 
			
		
	
		
			
				
					|  |  |  |   private extractRecipientDid(claim: Claim) { | 
			
		
	
		
			
				
					|  |  |  |     // eslint-disable-next-line @typescript-eslint/no-explicit-any | 
			
		
	
		
			
				
					|  |  |  |     return claim.recipient?.identifier || (claim.recipient as any)?.did; | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  | @ -1056,7 +1097,7 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private shouldIncludeRecord( | 
			
		
	
		
			
				
					|  |  |  |     record: GiveSummaryRecord, | 
			
		
	
		
			
				
					|  |  |  |     fulfillsPlan: any, | 
			
		
	
		
			
				
					|  |  |  |     fulfillsPlan?: FulfillsPlan, | 
			
		
	
		
			
				
					|  |  |  |   ): boolean { | 
			
		
	
		
			
				
					|  |  |  |     if (!this.isAnyFeedFilterOn) { | 
			
		
	
		
			
				
					|  |  |  |       return true; | 
			
		
	
	
		
			
				
					|  |  | @ -1090,7 +1131,7 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    * @internal | 
			
		
	
		
			
				
					|  |  |  |    * Called by processRecord() | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private extractProvider(claim: any) { | 
			
		
	
		
			
				
					|  |  |  |   private extractProvider(claim: Claim): Provider | undefined { | 
			
		
	
		
			
				
					|  |  |  |     return Array.isArray(claim.provider) ? claim.provider[0] : claim.provider; | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -1100,7 +1141,7 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    * @internal | 
			
		
	
		
			
				
					|  |  |  |    * Called by processRecord() | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private async getProvidedByPlan(provider: any) { | 
			
		
	
		
			
				
					|  |  |  |   private async getProvidedByPlan(provider: Provider | undefined) { | 
			
		
	
		
			
				
					|  |  |  |     return await getPlanFromCache( | 
			
		
	
		
			
				
					|  |  |  |       provider?.identifier as string, | 
			
		
	
		
			
				
					|  |  |  |       this.axios, | 
			
		
	
	
		
			
				
					|  |  | @ -1138,12 +1179,12 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private createFeedRecord( | 
			
		
	
		
			
				
					|  |  |  |     record: GiveSummaryRecord, | 
			
		
	
		
			
				
					|  |  |  |     claim: any, | 
			
		
	
		
			
				
					|  |  |  |     claim: Claim, | 
			
		
	
		
			
				
					|  |  |  |     giverDid: string, | 
			
		
	
		
			
				
					|  |  |  |     recipientDid: string, | 
			
		
	
		
			
				
					|  |  |  |     provider: any, | 
			
		
	
		
			
				
					|  |  |  |     fulfillsPlan: any, | 
			
		
	
		
			
				
					|  |  |  |     providedByPlan: any, | 
			
		
	
		
			
				
					|  |  |  |     provider: Provider | undefined, | 
			
		
	
		
			
				
					|  |  |  |     fulfillsPlan?: FulfillsPlan, | 
			
		
	
		
			
				
					|  |  |  |     providedByPlan?: ProvidedByPlan, | 
			
		
	
		
			
				
					|  |  |  |   ): GiveRecordWithContactInfo { | 
			
		
	
		
			
				
					|  |  |  |     return { | 
			
		
	
		
			
				
					|  |  |  |       ...record, | 
			
		
	
	
		
			
				
					|  |  | @ -1202,14 +1243,16 @@ export default class HomeView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |    * @internal | 
			
		
	
		
			
				
					|  |  |  |    * Called by updateAllFeed() | 
			
		
	
		
			
				
					|  |  |  |    */ | 
			
		
	
		
			
				
					|  |  |  |   private handleFeedError(e: any) { | 
			
		
	
		
			
				
					|  |  |  |   private handleFeedError(e: unknown) { | 
			
		
	
		
			
				
					|  |  |  |     logger.error("Error with feed load:", e); | 
			
		
	
		
			
				
					|  |  |  |     this.$notify( | 
			
		
	
		
			
				
					|  |  |  |       { | 
			
		
	
		
			
				
					|  |  |  |         group: "alert", | 
			
		
	
		
			
				
					|  |  |  |         type: "danger", | 
			
		
	
		
			
				
					|  |  |  |         title: "Feed Error", | 
			
		
	
		
			
				
					|  |  |  |         text: e.userMessage || "There was an error retrieving feed data.", | 
			
		
	
		
			
				
					|  |  |  |         text: | 
			
		
	
		
			
				
					|  |  |  |           (e as FeedError)?.userMessage || | 
			
		
	
		
			
				
					|  |  |  |           "There was an error retrieving feed data.", | 
			
		
	
		
			
				
					|  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |       -1, | 
			
		
	
		
			
				
					|  |  |  |     ); | 
			
		
	
	
		
			
				
					|  |  | 
 |