Skip to content

Commit

Permalink
fix desktop app
Browse files Browse the repository at this point in the history
  • Loading branch information
HieronymusLex committed Dec 29, 2020
1 parent 15c3e03 commit 1b577b8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"dependencies": {
"@holdem-poker-tools/hand-matrix": "^0.2.1",
"ajv": "^7.0.2",
"antd": "^4.9.4",
"electron-is-dev": "^1.2.0",
"electron-updater": "^4.3.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const createAppWindow = async () => {
}

const validateRange = (range) => {
const ajv = new Ajv();
const ajv = new Ajv.default({strict: false});
if (!ajv.validate(require("./range.schema.json"), range))
throw new Error(`Invalid range: ${ajv.errorsText()}`);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/ViewRanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const ViewRanges = () => {

const RangeTile = ({ range, frequencyMode, refreshRate }) => {
const history = useHistory();
const [rng, setRng] = useState(5);
const [rng, setRng] = useState(15);
let {title, author, actions, combos, tags, _id} = range;

useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/ranges/range.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"combos": {
"$id": "combos",
"type": "object",
"additionalProperties": false,
"maxProperties": 169,
"minProperties": 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/utils/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fileDownload from "js-file-download";
import Ajv from "ajv";
import schema from "../data/range.schema.json";

const ajv = new Ajv();
const ajv = new Ajv({strict: false});
ajv.addSchema(schema);
export const validateActions = ajv.getSchema("actions");
export const validateCombos = ajv.getSchema("combos");
Expand Down

0 comments on commit 1b577b8

Please sign in to comment.