mirror of
https://github.com/RoboSats/robosats.git
synced 2024-09-11 14:05:51 +03:00
Disable 'open dispute' button until fiat exchange midtime
This commit is contained in:
parent
40504a9e95
commit
94ecfe3929
@ -1060,12 +1060,26 @@ handleRatingRobosatsChange=(e)=>{
|
||||
)
|
||||
}
|
||||
|
||||
disputeCountdownRenderer = ({ hours, minutes}) => {
|
||||
return (<span>{hours}h {zeroPad(minutes)}m </span>);
|
||||
};
|
||||
|
||||
showOpenDisputeButton(){
|
||||
const { t } = this.props;
|
||||
let now = Date.now();
|
||||
var expires_at = new Date(this.props.data.expires_at);
|
||||
// open dispute button enables 12h before expiry
|
||||
expires_at.setHours(expires_at.getHours() - 12);
|
||||
return(
|
||||
<Tooltip
|
||||
disableHoverListener={now>expires_at}
|
||||
disableTouchListener={now>expires_at}
|
||||
enterTouchDelay={0}
|
||||
title={<Trans i18nKey="open_dispute">To open a dispute you need to wait <Countdown date={expires_at} renderer={this.disputeCountdownRenderer}/></Trans>}>
|
||||
<Grid item xs={12} align="center">
|
||||
<Button color="inherit" onClick={this.handleClickOpenConfirmDispute}>{t("Open Dispute")}</Button>
|
||||
<Button disabled={now<expires_at} color="inherit" onClick={this.handleClickOpenConfirmDispute}>{t("Open Dispute")}</Button>
|
||||
</Grid>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1318,7 +1332,7 @@ handleRatingRobosatsChange=(e)=>{
|
||||
<span>{zeroPad(minutes)}m {zeroPad(seconds)}s </span>
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
failureReason=()=>{
|
||||
const { t } = this.props;
|
||||
|
@ -404,6 +404,7 @@
|
||||
"Your TXID":"Your TXID",
|
||||
"Lightning":"Lightning",
|
||||
"Onchain":"Onchain",
|
||||
"open_dispute":"To open a dispute you need to wait <1><1/>",
|
||||
|
||||
|
||||
"INFO DIALOG - InfoDiagog.js":"App information and clarifications and terms of use",
|
||||
|
@ -405,6 +405,8 @@
|
||||
"Your TXID":"Tu TXID",
|
||||
"Lightning":"Lightning",
|
||||
"Onchain":"Onchain",
|
||||
"open_dispute":"Para abrir una disputa debes esperar <1><1/>",
|
||||
|
||||
|
||||
"INFO DIALOG - InfoDiagog.js": "App information and clarifications and terms of use",
|
||||
"Close": "Cerrar",
|
||||
|
Loading…
Reference in New Issue
Block a user