Skip to content

Commit

Permalink
fixes bug where you edit and save a job with every 10 minutes without…
Browse files Browse the repository at this point in the history
… changing the frequency
  • Loading branch information
nyoungstudios committed Aug 2, 2020
1 parent 352e5b7 commit 6d69daa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ function createForEdit(trEdit) {
$('#hk-slide-panels').arrive(frequencySelector, {onceOnly: true}, function(elem) {
convertTimeOnSidePanel(frequencySelector, false);

var originalOption = $(elem).find("option:selected").text();

// event handler for the Save Job button to be clicked
$(saveJobButton).on('click', function() {
var selectedOption = $(elem).find("option:selected").text();
Expand All @@ -206,7 +208,11 @@ function createForEdit(trEdit) {
var newTime = $('#scheduling-offset-select').find("option:selected").text();
updateRowNewTimes(thatParent, updateFormat1ToNewTime(newTime), updateFormat2ToNewTime(newTime));
} else if (selectedOption.includes('Every 10 minutes')) {
updateRowNewTimes(thatParent, 'Every 10 minutes', updateFormat2ToNewTime10Minutes());
// only update row if this every 10 minute option was a different than the original option
// in order words, if it was the same option...it is basically like not changing anything
if (originalOption != selectedOption) {
updateRowNewTimes(thatParent, 'Every 10 minutes', updateFormat2ToNewTime10Minutes());
}
} else if (selectedOption.includes('Every hour at...')) {
var newTime = $('#scheduling-offset-select').find("option:selected").text();
var newTimeTrim = newTime.trim().substring(1);
Expand Down

0 comments on commit 6d69daa

Please sign in to comment.