File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
packages/invoice-dashboard/src/lib Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 6868 signer = wallet ?.accounts [0 ]?.address ;
6969 }
7070
71- $ : isRequestPayed , getRequests (), ( activeRequest = undefined );
71+ $ : isRequestPayed , getOneRequest ( activeRequest );
7272
7373 onMount (() => {
7474 currencyManager = initializeCurrencyManager (currencies );
9393 }
9494 };
9595
96+ const getOneRequest = async (activeRequest : any ) => {
97+ try {
98+ loading = true ;
99+
100+ const _request = await requestNetwork ?.fromRequestId (
101+ activeRequest ?.requestId !
102+ );
103+
104+ requests = requests ?.filter (
105+ (request ) => request .requestId !== activeRequest .requestId
106+ );
107+ requests = [... requests , _request .getData ()].sort (
108+ (a , b ) => b .timestamp - a .timestamp
109+ );
110+
111+ loading = false ;
112+ } catch (error ) {
113+ loading = false ;
114+ console .error (" Failed to fetch request:" , error );
115+ }
116+ };
117+
96118 $ : {
97119 if (requests && loading ) {
98120 loading = false ;
You can’t perform that action at this time.
0 commit comments