Skip to content

Commit

Permalink
Merge pull request #354 from SamGraber/autosave
Browse files Browse the repository at this point in the history
Autosave fix
  • Loading branch information
Sam Graber authored Oct 20, 2016
2 parents fb1e7d8 + 925e323 commit c609a85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bootstrapper/forms/formsNg2.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h5>Form with names</h5>
<rlButtonSubmit rightAligned="true">Submit right</rlButtonSubmit>
</rlForm>
<h5>Autosave form</h5>
<rlBusy [loading]="autosaveAction.saving || autosaveAction.complete"></rlBusy>
<rlBusy [loading]="(autosaveAction.saving$ | async) || (autosaveAction.complete$ | async)"></rlBusy>
<rlForm #autosaveForm [save]="waitCallback" rlAutosave [saveWhenInvalid]="true">
<rlTextbox name="textbox1" label="Autosave textbox" rlRequired="Required textbox"></rlTextbox>
</rlForm>
Expand Down
2 changes: 1 addition & 1 deletion source/behaviors/autosave/autosave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AutosaveDirective implements AfterViewInit {
}

setDebounce = (): void => {
if (!this.timer && (this.saveWhenInvalid || this.form.validate())) {
if (!this.timer && this.form.dirty && (this.saveWhenInvalid || this.form.validate())) {
this.timer = this.timeoutService.setTimeout(this.autosave, DEFAULT_AUTOSAVE_DEBOUNCE)
.catch(() => null);
}
Expand Down

0 comments on commit c609a85

Please sign in to comment.