Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 5198d63

Browse files
authored
Merge pull request #1902 from OpenBazaar/brian.fixmoderators
Brian.fixmoderators
2 parents 4fccb98 + a4765e8 commit 5198d63

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

js/utils/currency.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,20 @@ export function validateCurrencyAmount(amount, divisibility, options = {}) {
977977
returnVal.validRequired = true;
978978

979979
const bigNum = bigNumber(amount);
980+
console.log(amount);
981+
982+
if (
983+
(
984+
opts.requireBigNumAmount &&
985+
!(amount instanceof bigNumber)
986+
) ||
987+
(bigNum.isNaN())
988+
) {
989+
returnVal.validType = false;
990+
return returnVal;
991+
}
992+
993+
returnVal.validType = true;
980994

981995
switch (opts.rangeType) {
982996
case CUR_VAL_RANGE_TYPES.GREATER_THAN_ZERO:

js/views/components/moderators/Moderators.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import baseVw from '../../baseVw';
1111
import { openSimpleMessage } from '../../modals/SimpleMessage';
1212
import ModCard from './Card';
1313
import ModeratorsStatus from './Status';
14+
import bigNumber from "bignumber.js";
1415

1516
export default class extends baseVw {
1617
/**
@@ -153,6 +154,11 @@ export default class extends baseVw {
153154
const modCurs = data.moderatorInfo && data.moderatorInfo.acceptedCurrencies || [];
154155
const supportedCur = anySupportedByWallet(modCurs);
155156

157+
if(data.moderatorInfo.fee.feeType == "FIXED_PLUS_PERCENTAGE" &&
158+
!(data.moderatorInfo.fee.fixedFee.amount instanceof bigNumber) ) {
159+
data.moderatorInfo.fee.fixedFee.amount = bigNumber(data.moderatorInfo.fee.fixedFee.amount);
160+
}
161+
156162
if ((!!isAMod && supportedCur || this.options.showInvalid)) {
157163
const newMod = new Moderator(data, { parse: true });
158164
if (newMod.isValid()) this.moderatorsCol.add(newMod);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openbazaar-desktop",
33
"productName": "OpenBazaar Desktop Client",
4-
"version": "2.4.5",
4+
"version": "2.4.6",
55
"serverVersionRequired": "0.14.3",
66
"description": "Decentralized p2p marketplace that uses Cryptocurrencies.",
77
"main": "bootstrapper.js",

0 commit comments

Comments
 (0)