Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

fix(analysis): skip reset if edit is cancled #1187

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/analysis/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ export default class AnalysisIndexRoute extends Route {
model() {
/* eslint-disable-next-line ember/no-controller-access-in-routes */
const controller = this.controllerFor("analysis.index");
const skipReset = controller.skipResetOnSetup;
next(() => {
controller._reset();
if (!skipReset) {
controller._reset();
}
});
}

Expand Down
8 changes: 5 additions & 3 deletions app/components/task-selection/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

if (this.args.liveTracking) {
// we track "_activity" here since we can not track the public getters directly
this.tracking.addObserver(

Check warning on line 64 in app/components/task-selection/component.js

View workflow job for this annotation

GitHub Actions / Lint (js)

Don't use observers
"_activity",
this.handleTrackingActiveActivityChanged.perform
);
Expand Down Expand Up @@ -97,6 +97,8 @@
task: null,
};

const options = { preventAction: true };

// the objects are possibily wrapped in a proxy which would
// confuse the upcoming null check
const [customer, project, task] = await Promise.all([
Expand All @@ -106,11 +108,11 @@
]);

if (task) {
this.onTaskChange(task);
this.onTaskChange(task, options);
} else if (project) {
this.onProjectChange(project);
this.onProjectChange(project, options);
} else if (customer) {
this.onCustomerChange(customer);
this.onCustomerChange(customer, options);
} else {
this.tracking.fetchCustomers.perform();
}
Expand Down
Loading