ui: unload auth method when navigating away from form (#18651)
* unload record instead of rollback * unload record instead of rollback * add changelog * add rollback attrs back if record is not new
This commit is contained in:
parent
03b23a7970
commit
0f0b48eda4
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: cleanup unsaved auth method ember data record when navigating away from mount backend form
|
||||||
|
```
|
|
@ -33,7 +33,10 @@ export default class MountBackendForm extends Component {
|
||||||
willDestroy() {
|
willDestroy() {
|
||||||
// if unsaved, we want to unload so it doesn't show up in the auth mount list
|
// if unsaved, we want to unload so it doesn't show up in the auth mount list
|
||||||
super.willDestroy(...arguments);
|
super.willDestroy(...arguments);
|
||||||
this.args.mountModel.rollbackAttributes();
|
if (this.args.mountModel) {
|
||||||
|
const method = this.args.mountModel.isNew ? 'unloadRecord' : 'rollbackAttributes';
|
||||||
|
this.args.mountModel[method]();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkPathChange(type) {
|
checkPathChange(type) {
|
||||||
|
|
Loading…
Reference in New Issue