diff --git a/package.json b/package.json index b855ba3..db49c80 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "alertDescriptionMaxLength": 100, "dataFetchPaginationSize": 1500, "dataCacheLengthInDays": 730, - "maxSharesPerSensor": 10, "uploadImageMaxSize": 3000 }, "private": true, diff --git a/src/components/ShareDialog.jsx b/src/components/ShareDialog.jsx index 65abc1a..4b2c91c 100644 --- a/src/components/ShareDialog.jsx +++ b/src/components/ShareDialog.jsx @@ -74,7 +74,7 @@ class ShareDialog extends Component { this.setState({ ...this.state, email: evt.target.value }); } isInvalidValid = () => { - return this.state.loading || this.props.sensor.sharedTo.length >= pjson.settings.maxSharesPerSensor || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.state.email) + return this.state.loading || this.props.sensor.sharedTo.length >= this.props.sensor.subscription.maxSharesPerSensor || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.state.email) } keyDown = (e) => { if (e.key === 'Enter') { @@ -96,7 +96,7 @@ class ShareDialog extends Component { {this.props.sensor.sharedTo.length > 0 && <> -
{addVariablesInString(t("share_sensor_already_shared"), [this.props.sensor.sharedTo.length, pjson.settings.maxSharesPerSensor])}
+
{addVariablesInString(t("share_sensor_already_shared"), [this.props.sensor.sharedTo.length, this.props.sensor.subscription.maxSharesPerSensor])}
{this.props.sensor.sharedTo.map(x => { return diff --git a/src/states/Sensor.jsx b/src/states/Sensor.jsx index 5b50947..2b9b016 100644 --- a/src/states/Sensor.jsx +++ b/src/states/Sensor.jsx @@ -650,7 +650,7 @@ class Sensor extends Component { {t("share")} - {addVariablesInString(t("shared_to_x"), [this.props.sensor.sharedTo.length, pjson.settings.maxSharesPerSensor])} + {addVariablesInString(t("shared_to_x"), [this.props.sensor.sharedTo.length, this.props.sensor.subscription.maxSharesPerSensor])} } _hover={{}} /> diff --git a/src/states/ShareCenter.jsx b/src/states/ShareCenter.jsx index 98ecb01..c1530ff 100644 --- a/src/states/ShareCenter.jsx +++ b/src/states/ShareCenter.jsx @@ -45,7 +45,7 @@ const SensorsSharedByMeBox = (props) => { {props.sensor.name || props.sensor.sensor}
- {i18next.t("active_shares")} ({props.sensor.sharedTo.length}/{pjson.settings.maxSharesPerSensor}) + {i18next.t("active_shares")} ({props.sensor.sharedTo.length}/{props.sensor.subscription.maxSharesPerSensor})
{props.sensor.sharedTo.map((sharedWith, index) => ( @@ -128,7 +128,7 @@ const ShareCenter = () => { } let mySensors = sensors.filter(x => x.userIsOwner) - let sensorsThatCanBeShared = mySensors.filter(x => x.sharedTo.length < pjson.settings.maxSharesPerSensor) + let sensorsThatCanBeShared = mySensors.filter(x => x.sharedTo.length < x.subscription.maxSharesPerSensor) sensorsThatCanBeShared = sensorsThatCanBeShared.filter(sensor => !selectedSensors.includes(sensor.sensor)); const selectSensorTitle =
{i18next.t("sensors_select_label")}