Skip to content

Commit

Permalink
Fix Ticket ID undefined BUG
Browse files Browse the repository at this point in the history
Fixed an undefined ticket ID BUG when monitoring a new website when the ticket ID field and the list of monitored websites are empty
  • Loading branch information
Felix83000 committed Jun 23, 2022
1 parent df4479d commit d1c4e78
Show file tree
Hide file tree
Showing 5 changed files with 1,618 additions and 1,680 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,14 @@ export class SuspiciousSites extends Component {
let getMax;
getMax = (arr, prop) => {
var max;
for (var i=0 ; i<arr.length ; i++) {
if (max == null || parseInt(arr[i][prop]) > parseInt(max[prop]))
max = arr[i];
if (arr.length !== 0) {
for (var i=0 ; i<arr.length ; i++) {
if (max == null || parseInt(arr[i][prop]) > parseInt(max[prop]))
max = arr[i];
}
max=max.rtir
} else {
max=0;
}
return max;
};
Expand All @@ -291,7 +296,7 @@ export class SuspiciousSites extends Component {
onSubmit = e => {
e.preventDefault();
const domain_name = this.inputDomainRef.current.value;
const rtir = this.inputRtirRef.current.value ? this.inputRtirRef.current.value : getMax(this.props.sites, "rtir").rtir+1;
const rtir = this.inputRtirRef.current.value ? this.inputRtirRef.current.value : getMax(this.props.sites, "rtir")+1;
const expiry = this.state.day;
const ip_monitoring = this.ipMonitoringRef.current.checked;
const content_monitoring = this.webContentMonitoringRef.current.checked;
Expand Down
2 changes: 1 addition & 1 deletion Watcher/Watcher/frontend/static/frontend/main.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Watcher/Watcher/frontend/static/frontend/main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ object-assign
* Released under the MIT License
*/

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/** @license React v0.19.1
* scheduler.production.min.js
*
Expand Down Expand Up @@ -53,6 +55,15 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

//! moment.js

//! moment.js locale configuration
Loading

0 comments on commit d1c4e78

Please sign in to comment.