Skip to content

Commit

Permalink
imp(add-rule): do not overuse hardcoded number
Browse files Browse the repository at this point in the history
  • Loading branch information
e11sy committed Feb 1, 2025
1 parent ce63fa0 commit 1193d3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/project/settings/NotificationsAddRule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ export default Vue.extend({
* Set selecteable fields to currently saved un rule
* If nothing is stored in rule, set default values
*/
this.$data.selectedThreshold = this.rule.threshold?.toString() ?? '100';
if (this.rule.threshold !== undefined) {
this.$data.selectedThreshold = this.rule.threshold.toString();
}
this.$data.selectedThresholdPeriod = this.seenMoreThresholdPeriod.find((option) => {
return option.id === millisecondsToThresholdPeriod.get(this.rule.thresholdPeriod ?? 3600000);
}) as CustomSelectOption;
Expand Down

0 comments on commit 1193d3a

Please sign in to comment.