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

Commit

Permalink
Merge pull request #1902 from OpenBazaar/brian.fixmoderators
Browse files Browse the repository at this point in the history
Brian.fixmoderators
  • Loading branch information
hoffmabc authored Jul 7, 2020
2 parents 4fccb98 + a4765e8 commit 5198d63
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
14 changes: 14 additions & 0 deletions js/utils/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,20 @@ export function validateCurrencyAmount(amount, divisibility, options = {}) {
returnVal.validRequired = true;

const bigNum = bigNumber(amount);
console.log(amount);

if (
(
opts.requireBigNumAmount &&
!(amount instanceof bigNumber)
) ||
(bigNum.isNaN())
) {
returnVal.validType = false;
return returnVal;
}

returnVal.validType = true;

switch (opts.rangeType) {
case CUR_VAL_RANGE_TYPES.GREATER_THAN_ZERO:
Expand Down
6 changes: 6 additions & 0 deletions js/views/components/moderators/Moderators.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import baseVw from '../../baseVw';
import { openSimpleMessage } from '../../modals/SimpleMessage';
import ModCard from './Card';
import ModeratorsStatus from './Status';
import bigNumber from "bignumber.js";

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

if(data.moderatorInfo.fee.feeType == "FIXED_PLUS_PERCENTAGE" &&
!(data.moderatorInfo.fee.fixedFee.amount instanceof bigNumber) ) {
data.moderatorInfo.fee.fixedFee.amount = bigNumber(data.moderatorInfo.fee.fixedFee.amount);
}

if ((!!isAMod && supportedCur || this.options.showInvalid)) {
const newMod = new Moderator(data, { parse: true });
if (newMod.isValid()) this.moderatorsCol.add(newMod);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openbazaar-desktop",
"productName": "OpenBazaar Desktop Client",
"version": "2.4.5",
"version": "2.4.6",
"serverVersionRequired": "0.14.3",
"description": "Decentralized p2p marketplace that uses Cryptocurrencies.",
"main": "bootstrapper.js",
Expand Down

0 comments on commit 5198d63

Please sign in to comment.