Fix swap dispute prompts

This commit is contained in:
Reckless_Satoshi 2022-12-01 02:18:42 -08:00
parent cc87054246
commit a7ad9c8c7e
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 9 additions and 9 deletions

View File

@ -8,17 +8,17 @@ interface Props {
}
const LinearDeterminate = ({ expiresAt, totalSecsExp }: Props): JSX.Element => {
const timePercentLeft = function(){
if (expiresAt && totalSecsExp){
const timePercentLeft = function () {
if (expiresAt && totalSecsExp) {
const lapseTime = calcTimeDelta(new Date(expiresAt)).total / 1000;
return (lapseTime / totalSecsExp) * 100;
} else {
return 100;
}
}
};
const [progress, setProgress] = useState<number>(timePercentLeft);
useEffect(() => {
const timer = setInterval(() => {
setProgress(timePercentLeft);

View File

@ -603,15 +603,15 @@ const TradeBox = ({
// 18: 'Taker lost dispute'
} else if ((status == 17 && isMaker) || (status == 18 && !isMaker)) {
title = 'You have won the dispute';
prompt = function () {
return <DisputeWinnerPrompt />;
};
} else if ((status == 17 && !isMaker) || (status == 18 && isMaker)) {
title = 'You have lost the dispute';
prompt = function () {
return <DisputeLoserPrompt />;
};
bondStatus = 'settled';
} else if ((status == 17 && !isMaker) || (status == 18 && isMaker)) {
title = 'You have lost the dispute';
prompt = function () {
return <DisputeWinnerPrompt />;
};
}
return { title, titleVariables, titleColor, prompt, bondStatus, titleIcon };