Skip to content

Commit

Permalink
Change timeout error in LSPStore and format some order response values
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamkmr04 committed May 1, 2024
1 parent c498e24 commit addeb6e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 12 deletions.
5 changes: 2 additions & 3 deletions stores/LSPStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,8 @@ export default class LSPStore {
let timer = 10000;
const timeoutId = setTimeout(() => {
this.error = true;
this.error_msg = `Timeout error: Data not received within ${
timer / 1000
} seconds`;
this.error_msg = 'Did not receive response from server';
this.loading = false;
}, timer);

if (this.settingsStore.implementation === 'embedded-lnd') {
Expand Down
58 changes: 49 additions & 9 deletions views/Settings/LSPS1/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from 'react-native';
import EncryptedStorage from 'react-native-encrypted-storage';
import Slider from '@react-native-community/slider';
import moment from 'moment';
import { v4 as uuidv4 } from 'uuid';

import CaretDown from '../../../assets/images/SVG/Caret Down.svg';
Expand All @@ -25,6 +26,7 @@ import KeyValue from '../../../components/KeyValue';
import Switch from '../../../components/Switch';
import { ErrorMessage } from '../../../components/SuccessErrorMessage';
import { Row } from '../../../components/layout/Row';
import Amount from '../../../components/Amount';

import BackendUtils from '../../../utils/BackendUtils';
import { themeColor } from '../../../utils/ThemeUtils';
Expand Down Expand Up @@ -368,9 +370,15 @@ export default class LSPS1 extends React.Component<LSPS1Props, LSPS1State> {
)}
{result.client_balance_sat && (
<KeyValue
keyValue="Client Balance (SAT)"
keyValue="Client Balance"
value={
result.client_balance_sat
<Amount
sats={
result.client_balance_sat
}
toggleable
sensitive
/>
}
/>
)}
Expand All @@ -385,19 +393,35 @@ export default class LSPS1 extends React.Component<LSPS1Props, LSPS1State> {
{result.created_at && (
<KeyValue
keyValue="Created At"
value={result.created_at}
value={moment(
result.createdAt
).format(
'MMM Do YYYY, h:mm:ss a'
)}
/>
)}
{result.expires_at && (
<KeyValue
keyValue="Expires At"
value={result.expires_at}
value={moment(
result.expires_at
).format(
'MMM Do YYYY, h:mm:ss a'
)}
/>
)}
{result.lsp_balance_sat && (
<KeyValue
keyValue="LSP Balance (SAT)"
value={result.lsp_balance_sat}
keyValue="LSP Balance"
value={
<Amount
sats={
result.lsp_balance_sat
}
toggleable
sensitive
/>
}
/>
)}
{result.order_id && (
Expand All @@ -416,7 +440,15 @@ export default class LSPS1 extends React.Component<LSPS1Props, LSPS1State> {
{payment.fee_total_sat && (
<KeyValue
keyValue="Fee Total SAT"
value={payment.fee_total_sat}
value={
<Amount
sats={
payment.fee_total_sat
}
toggleable
sensitive
/>
}
/>
)}
{(payment.lightning_invoice ||
Expand Down Expand Up @@ -465,8 +497,16 @@ export default class LSPS1 extends React.Component<LSPS1Props, LSPS1State> {
)}
{payment.order_total_sat && (
<KeyValue
keyValue="Order Total SAT"
value={payment.order_total_sat}
keyValue="Order Total "
value={
<Amount
sats={
payment.order_total_sat
}
toggleable
sensitive
/>
}
/>
)}
</View>
Expand Down

0 comments on commit addeb6e

Please sign in to comment.