From 60c694fb195e66d901ad500992534da1a3cec3ec Mon Sep 17 00:00:00 2001 From: MV88 Date: Fri, 9 Feb 2024 13:05:00 +0100 Subject: [PATCH] fix lint --- web/client/components/maps/forms/Thumbnail.jsx | 1 + web/client/utils/cesium/MathUtils.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web/client/components/maps/forms/Thumbnail.jsx b/web/client/components/maps/forms/Thumbnail.jsx index b1bef30580..3e5c24ffc8 100644 --- a/web/client/components/maps/forms/Thumbnail.jsx +++ b/web/client/components/maps/forms/Thumbnail.jsx @@ -11,6 +11,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import Message from '../../../components/I18N/Message'; import { getResourceIdFromURL } from '../../../utils/ResourceUtils'; +import { randomInt } from '../../../utils/cesium/MathUtils'; import Thumbnail from '../../misc/Thumbnail'; const errorMessages = { diff --git a/web/client/utils/cesium/MathUtils.js b/web/client/utils/cesium/MathUtils.js index 666482cc3c..89bfb5e7d4 100644 --- a/web/client/utils/cesium/MathUtils.js +++ b/web/client/utils/cesium/MathUtils.js @@ -91,7 +91,7 @@ export function computeSlopes(coordinates, cameraPosition) { */ export const randomFloat = function () { const int = window.crypto.getRandomValues(new Uint32Array(1))[0]; - return int / 2**32; + return int / 2 ** 32; } /** @@ -100,6 +100,6 @@ export const randomFloat = function () { * @todo check that min is <= max. */ export const randomInt = function (max, min = 0) { - const range = max - min - return Math.floor(randomFloat() * range + min) - } + const range = max - min; + return Math.floor(randomFloat() * range + min); +};