Refresh Invoice Bug Fix

Refresh Invoice Bug Fix
pull/773/head
Shahana Farooqui 3 years ago
parent c1d7e22642
commit 4ef50a1f85

@ -13,6 +13,6 @@
<style>@font-face{font-family:Roboto;src:url(Roboto-Thin.dbd56bd3357dc3617fe5.woff2) format("woff2"),url(Roboto-Thin.e7f7c82374bd0ebef14b.woff) format("woff");font-weight:100;font-style:normal;}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.a8cef84f735ef887abdc.woff2) format("woff2"),url(Roboto-ThinItalic.5dd9349c940073834e9a.woff) format("woff");font-weight:100;font-style:italic;}@font-face{font-family:Roboto;src:url(Roboto-Light.c27d89ac77468ae18f28.woff2) format("woff2"),url(Roboto-Light.d923dfafc0c5183b59aa.woff) format("woff");font-weight:300;font-style:normal;}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.506274c7228cf81cae4d.woff2) format("woff2"),url(Roboto-LightItalic.d4b8c137518d9d92bb28.woff) format("woff");font-weight:300;font-style:italic;}@font-face{font-family:Roboto;src:url(Roboto-Regular.64cfb66c866ea50cad47.woff2) format("woff2"),url(Roboto-Regular.e02e9d6ff5547f7e9962.woff) format("woff");font-weight:400;font-style:normal;}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.4dd2af1e8df532f41db8.woff2) format("woff2"),url(Roboto-RegularItalic.5ea38fff9eebef99c5df.woff) format("woff");font-weight:400;font-style:italic;}@font-face{font-family:Roboto;src:url(Roboto-Medium.1d3bced88509b0838984.woff2) format("woff2"),url(Roboto-Medium.092c6130df8fd2199888.woff) format("woff");font-weight:500;font-style:normal;}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.d620b8f53f75966fe42e.woff2) format("woff2"),url(Roboto-MediumItalic.18ff1628c628080166c1.woff) format("woff");font-weight:500;font-style:italic;}@font-face{font-family:Roboto;src:url(Roboto-Bold.92fbd4e93cf0a5dbebaa.woff2) format("woff2"),url(Roboto-Bold.73288d91c325e82a5b92.woff) format("woff");font-weight:700;font-style:normal;}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.5f600d98a73d800ae575.woff2) format("woff2"),url(Roboto-BoldItalic.6d89acbd21d7e3fbecb2.woff) format("woff");font-weight:700;font-style:italic;}@font-face{font-family:Roboto;src:url(Roboto-Black.41ed1105a6ebb8ffe34e.woff2) format("woff2"),url(Roboto-Black.937491dfcbe64ca9a9f1.woff) format("woff");font-weight:900;font-style:normal;}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.50ca4c51ebc27e7e7d2f.woff2) format("woff2"),url(Roboto-BlackItalic.2e1ee657996854c6f427.woff) format("woff");font-weight:900;font-style:italic;}html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:62.5%;}body{box-sizing:border-box;margin:0;}body{height:100%;overflow:hidden;}*{margin:0;padding:0;}</style><link rel="stylesheet" href="styles.50804d64c130486c55c1.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.50804d64c130486c55c1.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.f5bf3b7e70912bf34aaa.js" defer></script><script src="polyfills.a979cbbe16939013cdcf.js" defer></script><script src="main.522ca56ef954d078d551.js" defer></script>
<script src="runtime.4a79e9ea8cac58872cb0.js" defer></script><script src="polyfills.a979cbbe16939013cdcf.js" defer></script><script src="main.065484d901c5e9c31fff.js" defer></script>
</body></html>

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
(()=>{"use strict";var e,r,t,a={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={id:e,loaded:!1,exports:{}};return a[e].call(t.exports,t,t.exports,n),t.loaded=!0,t.exports}n.m=a,e=[],n.O=(r,t,a,o)=>{if(!t){var l=1/0;for(s=0;s<e.length;s++){for(var[t,a,o]=e[s],d=!0,i=0;i<t.length;i++)(!1&o||l>=o)&&Object.keys(n.O).every(e=>n.O[e](t[i]))?t.splice(i--,1):(d=!1,o<l&&(l=o));d&&(e.splice(s--,1),r=a())}return r}o=o||0;for(var s=e.length;s>0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[t,a,o]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+"."+{145:"5a48daaf78a431c6ac04",432:"233efd0eaffca79461bd",891:"0cd709adfaf43d19a339",958:"88b5fa8d3b93e7a0e7b3"}[e]+".js",n.miniCssF=e=>"styles.50804d64c130486c55c1.css",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},t="rtl:",n.l=(e,a,o,l)=>{if(r[e])r[e].push(a);else{var d,i;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var c=s[u];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==t+o){d=c;break}}d||(i=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,n.nc&&d.setAttribute("nonce",n.nc),d.setAttribute("data-webpack",t+o),d.src=e),r[e]=[a];var f=(t,a)=>{d.onerror=d.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),o&&o.forEach(e=>e(a)),t)return t(a)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=f.bind(null,d.onerror),d.onload=f.bind(null,d.onload),i&&document.head.appendChild(d)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.p="",(()=>{var e={666:0};n.f.j=(r,t)=>{var a=n.o(e,r)?e[r]:void 0;if(0!==a)if(a)t.push(a[2]);else if(666!=r){var o=new Promise((t,o)=>a=e[r]=[t,o]);t.push(a[2]=o);var l=n.p+n.u(r),d=new Error;n.l(l,t=>{if(n.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=t&&("load"===t.type?"missing":t.type),l=t&&t.target&&t.target.src;d.message="Loading chunk "+r+" failed.\n("+o+": "+l+")",d.name="ChunkLoadError",d.type=o,d.request=l,a[1](d)}},"chunk-"+r,r)}else e[r]=0},n.O.j=r=>0===e[r];var r=(r,t)=>{var a,o,[l,d,i]=t,s=0;for(a in d)n.o(d,a)&&(n.m[a]=d[a]);if(i)var u=i(n);for(r&&r(t);s<l.length;s++)n.o(e,o=l[s])&&e[o]&&e[o][0](),e[l[s]]=0;return n.O(u)},t=self.webpackChunkrtl=self.webpackChunkrtl||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();

@ -1 +0,0 @@
(()=>{"use strict";var e,r,t,o={},a={};function n(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,loaded:!1,exports:{}};return o[e].call(t.exports,t,t.exports,n),t.loaded=!0,t.exports}n.m=o,e=[],n.O=(r,t,o,a)=>{if(!t){var l=1/0;for(s=0;s<e.length;s++){for(var[t,o,a]=e[s],i=!0,d=0;d<t.length;d++)(!1&a||l>=a)&&Object.keys(n.O).every(e=>n.O[e](t[d]))?t.splice(d--,1):(i=!1,a<l&&(l=a));i&&(e.splice(s--,1),r=o())}return r}a=a||0;for(var s=e.length;s>0&&e[s-1][2]>a;s--)e[s]=e[s-1];e[s]=[t,o,a]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+"."+{145:"bd793f88eee8abcb2b20",432:"cc664c98c4074918e24a",891:"4fbbfe370fa877de7f39",958:"88b5fa8d3b93e7a0e7b3"}[e]+".js",n.miniCssF=e=>"styles.50804d64c130486c55c1.css",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},t="rtl:",n.l=(e,o,a,l)=>{if(r[e])r[e].push(o);else{var i,d;if(void 0!==a)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var c=s[u];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==t+a){i=c;break}}i||(d=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,n.nc&&i.setAttribute("nonce",n.nc),i.setAttribute("data-webpack",t+a),i.src=e),r[e]=[o];var f=(t,o)=>{i.onerror=i.onload=null,clearTimeout(b);var a=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(o)),t)return t(o)},b=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),d&&document.head.appendChild(i)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.p="",(()=>{var e={666:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(666!=r){var a=new Promise((t,a)=>o=e[r]=[t,a]);t.push(o[2]=a);var l=n.p+n.u(r),i=new Error;n.l(l,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),l=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+l+")",i.name="ChunkLoadError",i.type=a,i.request=l,o[1](i)}},"chunk-"+r,r)}else e[r]=0},n.O.j=r=>0===e[r];var r=(r,t)=>{var o,a,[l,i,d]=t,s=0;for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(d)var u=d(n);for(r&&r(t);s<l.length;s++)n.o(e,a=l[s])&&e[a]&&e[a][0](),e[l[s]]=0;return n.O(u)},t=self.webpackChunkrtl=self.webpackChunkrtl||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();

@ -24,6 +24,7 @@ exports.listInvoices = (req, res, next) => {
options = common.getOptions();
const labelQuery = req.query.label ? '?label=' + req.query.label : '';
options.url = common.getSelLNServerUrl() + '/v1/invoice/listInvoices' + labelQuery;
logger.log({level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List URL', data: options.url});
request(options).then((body) => {
logger.log({level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List Received', data: body});
if ( body.invoices && body.invoices.length > 0) {

@ -40,6 +40,7 @@ exports.log = (msgJSON, selNode = common.selectedNode) => {
msgStr = msgStr + ': ' + (typeof msgJSON.data === 'object' ? JSON.stringify(msgJSON.data) : typeof msgJSON.data == 'string' ? msgJSON.data : '');
}
}
console.log(msgStr);
fs.appendFile(selNode.log_file, msgStr, () => {});
}
break;

@ -55,6 +55,7 @@ export const FETCH_INVOICES_CL = 'FETCH_INVOICES_CL';
export const SET_INVOICES_CL = 'SET_INVOICES_CL';
export const SAVE_NEW_INVOICE_CL = 'SAVE_NEW_INVOICE_CL';
export const ADD_INVOICE_CL = 'ADD_INVOICE_CL';
export const UPDATE_INVOICE_CL = 'UPDATE_INVOICE_CL';
export const DELETE_EXPIRED_INVOICE_CL = 'DELETE_EXPIRED_INVOICE_CL';
export const SET_CHANNEL_TRANSACTION_CL = 'SET_CHANNEL_TRANSACTION_CL';
export const SET_CHANNEL_TRANSACTION_RES_CL = 'SET_CHANNEL_TRANSACTION_RES_CL';
@ -388,6 +389,13 @@ export class AddInvoice implements Action {
}
export class UpdateInvoice implements Action {
readonly type = UPDATE_INVOICE_CL;
constructor(public payload: Invoice) {}
}
export class DeleteExpiredInvoice implements Action {
readonly type = DELETE_EXPIRED_INVOICE_CL;
@ -432,4 +440,4 @@ FetchPayments | SetPayments | SendPayment | SendPaymentStatus | DecodePayment |
GetQueryRoutes | SetQueryRoutes | SetChannelTransaction | SetChannelTransactionRes |
PeerLookup | ChannelLookup | InvoiceLookup | SetLookup |
GetForwardingHistory | SetForwardingHistory | GetFailedForwardingHistory | SetFailedForwardingHistory |
FetchInvoices | SetInvoices | SaveNewInvoice | AddInvoice | DeleteExpiredInvoice;
FetchInvoices | SetInvoices | SaveNewInvoice | AddInvoice | UpdateInvoice | DeleteExpiredInvoice;

@ -586,6 +586,9 @@ export class CLEffects implements OnDestroy {
this.logger.info(resInvoice);
this.store.dispatch(new CLActions.UpdateAPICallStatus({ action: 'Lookup', status: APICallStatusEnum.COMPLETED }));
this.store.dispatch(new RTLActions.CloseSpinner(UI_MESSAGES.SEARCHING_INVOICE));
if (resInvoice.invoices && resInvoice.invoices.length && resInvoice.invoices.length > 0) {
this.store.dispatch(new CLActions.UpdateInvoice(resInvoice.invoices[0]));
}
return {
type: CLActions.SET_LOOKUP_CL,
payload: resInvoice.invoices && resInvoice.invoices.length && resInvoice.invoices.length > 0 ? resInvoice.invoices[0] : resInvoice

@ -232,6 +232,13 @@ export function CLReducer(state = initCLState, action: CLActions.CLActions) {
...state,
invoices: action.payload
};
case CLActions.UPDATE_INVOICE_CL:
const modifiedInvoices = state.invoices;
modifiedInvoices.invoices = modifiedInvoices.invoices.map((invoice) => ((invoice.label === action.payload.label) ? action.payload : invoice));
return {
...state,
invoices: modifiedInvoices
};
case CLActions.SET_UTXOS_CL:
return {
...state,

@ -50,6 +50,7 @@ export const SET_INVOICES_ECL = 'SET_INVOICES_ECL';
export const SET_TOTAL_INVOICES_ECL = 'SET_TOTAL_INVOICES_ECL';
export const CREATE_INVOICE_ECL = 'CREATE_INVOICE_ECL';
export const ADD_INVOICE_ECL = 'ADD_INVOICE_ECL';
export const UPDATE_INVOICE_ECL = 'UPDATE_INVOICE_ECL';
export const PEER_LOOKUP_ECL = 'PEER_LOOKUP_ECL';
export const INVOICE_LOOKUP_ECL = 'INVOICE_LOOKUP_ECL';
export const SET_LOOKUP_ECL = 'SET_LOOKUP_ECL';
@ -354,6 +355,14 @@ export class AddInvoice implements Action {
}
export class UpdateInvoice implements Action {
readonly type = UPDATE_INVOICE_ECL;
constructor(public payload: Invoice) {}
}
export class PeerLookup implements Action {
readonly type = PEER_LOOKUP_ECL;
@ -385,4 +394,4 @@ export type ECLActions = ResetECLStore | UpdateAPICallStatus | SetChildNodeSetti
SetLightningBalance | FetchPeers | SetPeers | PeerLookup | InvoiceLookup | SetLookup |
SaveNewChannel | UpdateChannels | CloseChannel | RemoveChannel |
FetchPayments | SetPayments | SendPayment | SendPaymentStatus |
FetchInvoices | SetInvoices | CreateInvoice | AddInvoice;
FetchInvoices | SetInvoices | CreateInvoice | AddInvoice | UpdateInvoice;

@ -587,6 +587,7 @@ export class ECLEffects implements OnDestroy {
this.logger.info(resInvoice);
this.store.dispatch(new ECLActions.UpdateAPICallStatus({ action: 'Lookup', status: APICallStatusEnum.COMPLETED }));
this.store.dispatch(new RTLActions.CloseSpinner(UI_MESSAGES.SEARCHING_INVOICE));
this.store.dispatch(new ECLActions.UpdateInvoice(resInvoice));
return {
type: ECLActions.SET_LOOKUP_ECL,
payload: resInvoice

@ -204,6 +204,13 @@ export function ECLReducer(state = initECLState, action: ECLActions.ECLActions)
...state,
invoices: action.payload
};
case ECLActions.UPDATE_INVOICE_ECL:
let modifiedInvoices = state.invoices;
modifiedInvoices = modifiedInvoices.map((invoice) => ((invoice.paymentHash === action.payload.paymentHash) ? action.payload : invoice));
return {
...state,
invoices: modifiedInvoices
};
default:
return state;
}

@ -47,6 +47,7 @@ export const RESTORE_CHANNELS_LND = 'RESTORE_CHANNELS_LND';
export const RESTORE_CHANNELS_RES_LND = 'RESTORE_CHANNELS_RES_LND';
export const FETCH_INVOICES_LND = 'FETCH_INVOICES_LND';
export const SET_INVOICES_LND = 'SET_INVOICES_LND';
export const UPDATE_INVOICE_LND = 'UPDATE_INVOICE_LND';
export const SET_TOTAL_INVOICES_LND = 'SET_TOTAL_INVOICES_LND';
export const FETCH_TRANSACTIONS_LND = 'FETCH_TRANSACTIONS_LND';
export const SET_TRANSACTIONS_LND = 'SET_TRANSACTIONS_LND';
@ -351,6 +352,13 @@ export class SetInvoices implements Action {
}
export class UpdateInvoice implements Action {
readonly type = UPDATE_INVOICE_LND;
constructor(public payload: Invoice) {}
}
export class SetTotalInvoices implements Action {
readonly type = SET_TOTAL_INVOICES_LND;
@ -569,7 +577,7 @@ SaveNewChannel | CloseChannel | RemoveChannel |
BackupChannels | VerifyChannels | BackupChannelsRes | VerifyChannelsRes |
RestoreChannels | RestoreChannelsRes | RestoreChannelsList | SetRestoreChannelsList |
FetchTransactions | SetTransactions | FetchUTXOs | SetUTXOs |
FetchInvoices | SetInvoices | SetTotalInvoices |
FetchInvoices | SetInvoices | UpdateInvoice | SetTotalInvoices |
FetchPayments | SetPayments | SendPayment | SendPaymentStatus |
GetAllLightningTransactions | SetAllLightningTransactions |
FetchGraphNode | SetGraphNode | GetQueryRoutes | SetQueryRoutes |

@ -1044,6 +1044,7 @@ export class LNDEffects implements OnDestroy {
this.logger.info(resInvoice);
this.store.dispatch(new RTLActions.CloseSpinner(UI_MESSAGES.SEARCHING_INVOICE));
this.store.dispatch(new LNDActions.UpdateAPICallStatus({ action: 'Lookup', status: APICallStatusEnum.COMPLETED }));
this.store.dispatch(new LNDActions.UpdateInvoice(resInvoice));
return {
type: LNDActions.SET_LOOKUP_LND,
payload: resInvoice

@ -132,6 +132,13 @@ export function LNDReducer(state = initLNDState, action: LNDActions.LNDActions)
...state,
invoices: newInvoices
};
case LNDActions.UPDATE_INVOICE_LND:
const modifiedInvoices = state.invoices;
modifiedInvoices.invoices = modifiedInvoices.invoices.map((invoice) => ((invoice.r_hash === action.payload.r_hash) ? action.payload : invoice));
return {
...state,
invoices: modifiedInvoices
};
case LNDActions.SET_FEES_LND:
return {
...state,

Loading…
Cancel
Save