mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-21 22:11:37 +01:00
chore: correct version verification
This commit is contained in:
parent
9612835ebc
commit
d87d7cdab8
4 changed files with 18 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "app",
|
||||
"version": "0.1.8",
|
||||
"version": "0.1.9",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@apollo/react-hooks": "^3.1.3",
|
||||
|
|
|
@ -23,7 +23,7 @@ export const StatusCheck = () => {
|
|||
variables: { auth },
|
||||
skip: !connected || !loggedIn,
|
||||
pollInterval: 10000,
|
||||
onError: error => toast.error(getErrorContent(error)),
|
||||
onError: (error) => toast.error(getErrorContent(error)),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -44,12 +44,17 @@ export const StatusCheck = () => {
|
|||
const { confirmedBalance, pendingBalance } = getChannelBalance;
|
||||
|
||||
const versionNumber = version.split(' ');
|
||||
const onlyVersion = versionNumber[0].split('-');
|
||||
const numbers = onlyVersion[0].split('.');
|
||||
|
||||
const state = {
|
||||
loading: false,
|
||||
alias,
|
||||
syncedToChain: is_synced_to_chain,
|
||||
version: versionNumber[0],
|
||||
mayorVersion: numbers[0],
|
||||
minorVersion: numbers[1],
|
||||
revision: numbers[2],
|
||||
chainBalance: getChainBalance,
|
||||
chainPending: getPendingChainBalance,
|
||||
channelBalance: confirmedBalance,
|
||||
|
|
|
@ -5,6 +5,9 @@ type State = {
|
|||
alias: string;
|
||||
syncedToChain: boolean;
|
||||
version: string;
|
||||
mayorVersion: number;
|
||||
minorVersion: number;
|
||||
revision: number;
|
||||
chainBalance: number;
|
||||
chainPending: number;
|
||||
channelBalance: number;
|
||||
|
@ -37,6 +40,9 @@ const initialState = {
|
|||
alias: '',
|
||||
syncedToChain: false,
|
||||
version: '',
|
||||
mayorVersion: 0,
|
||||
minorVersion: 0,
|
||||
revision: 0,
|
||||
chainBalance: 0,
|
||||
chainPending: 0,
|
||||
channelBalance: 0,
|
||||
|
|
|
@ -26,7 +26,7 @@ import { useStatusState } from 'context/StatusContext';
|
|||
import { Text } from 'views/other/OtherViews.styled';
|
||||
|
||||
export const BalanceView = () => {
|
||||
const { version } = useStatusState();
|
||||
const { minorVersion } = useStatusState();
|
||||
const { host, viewOnly, cert, sessionAdmin } = useAccount();
|
||||
const auth = getAuthString(
|
||||
host,
|
||||
|
@ -44,10 +44,10 @@ export const BalanceView = () => {
|
|||
|
||||
const { loading, data } = useQuery(GET_CHANNELS, {
|
||||
variables: { auth, active: true },
|
||||
onError: error => toast.error(getErrorContent(error)),
|
||||
onError: (error) => toast.error(getErrorContent(error)),
|
||||
});
|
||||
|
||||
if (version !== '0.9.0-beta') {
|
||||
if (minorVersion < 9) {
|
||||
return (
|
||||
<CardWithTitle>
|
||||
<SingleLine>
|
||||
|
@ -185,7 +185,7 @@ export const BalanceView = () => {
|
|||
value={amount}
|
||||
placeholder={'Sats'}
|
||||
type={'number'}
|
||||
onChange={e => {
|
||||
onChange={(e) => {
|
||||
setAmount(parseInt(e.target.value));
|
||||
}}
|
||||
withMargin={'0 0 8px'}
|
||||
|
@ -204,7 +204,7 @@ export const BalanceView = () => {
|
|||
value={maxFee}
|
||||
placeholder={'Sats (Leave empty to search all routes)'}
|
||||
type={'number'}
|
||||
onChange={e => {
|
||||
onChange={(e) => {
|
||||
setMaxFee(parseInt(e.target.value));
|
||||
}}
|
||||
withMargin={'0 0 24px'}
|
||||
|
|
Loading…
Add table
Reference in a new issue