Skip to content

Commit

Permalink
feat: add clear logs before destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
ga-devfront committed Dec 11, 2024
1 parent 94a6d96 commit cf1b7fd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions _dev/src/ts/pages/UpdatePageUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ProgressTracker from '../components/ProgressTracker';
import { ApiResponseAction } from '../types/apiTypes';
import Process from '../utils/Process';
import api from '../api/RequestHandler';
import { logStore } from '../store/LogStore';

export default class UpdatePageUpdate extends UpdatePage {
protected stepCode = 'update';
Expand Down Expand Up @@ -33,6 +34,7 @@ export default class UpdatePageUpdate extends UpdatePage {
};

public beforeDestroy = () => {
logStore.clearLogs();
this.#progressTracker.beforeDestroy();

this.#restoreAlertForm?.removeEventListener('submit', this.#handleSubmit);
Expand All @@ -57,11 +59,11 @@ export default class UpdatePageUpdate extends UpdatePage {
};

#onProcessEnd = async (response: ApiResponseAction): Promise<void> => {
// if (response.error) {
this.#onError(response);
// } else {
// await api.post(this.#progressTrackerContainer.dataset.successRoute!);
// }
if (response.error) {
this.#onError(response);
} else {
await api.post(this.#progressTrackerContainer.dataset.successRoute!);
}
};

#onError = (response: ApiResponseAction): void => {
Expand Down

0 comments on commit cf1b7fd

Please sign in to comment.