Skip to content

Commit a65c805

Browse files
authored
Merge pull request #2773 from codecrafters-io/refactor-course-step-content-component
refactor: simplify StepContentComponent by removing state
2 parents eb04f2f + f7b1985 commit a65c805

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

app/components/course-page/step-content.ts

-28
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import { action } from '@ember/object';
2-
import { service } from '@ember/service';
31
import Component from '@glimmer/component';
4-
import { tracked } from '@glimmer/tracking';
52
import type RepositoryModel from 'codecrafters-frontend/models/repository';
6-
import type CoursePageStateService from 'codecrafters-frontend/services/course-page-state';
73
import Step from 'codecrafters-frontend/utils/course-page-step-list/step';
84

95
interface Signature {
@@ -20,33 +16,9 @@ interface Signature {
2016
}
2117

2218
export default class StepContentComponent extends Component<Signature> {
23-
@tracked previousStepsIncompleteModalWasDismissed = false;
24-
@tracked lastSeenStepId: string | null = null;
25-
26-
@service declare coursePageState: CoursePageStateService;
27-
2819
get shouldHideCompletionNotice(): boolean {
2920
return this.args.step.type === 'IntroductionStep' || this.args.step.type === 'SetupStep';
3021
}
31-
32-
get shouldShowPreviousStepsIncompleteModal(): boolean {
33-
return !this.previousStepsIncompleteModalWasDismissed && this.args.step.status === 'locked';
34-
}
35-
36-
@action
37-
handlePreviousStepsIncompleteModalDismissed() {
38-
this.previousStepsIncompleteModalWasDismissed = true;
39-
}
40-
41-
@action
42-
handleStepIdUpdated() {
43-
if (this.args.step.id === this.lastSeenStepId) {
44-
return;
45-
}
46-
47-
this.lastSeenStepId = this.args.step.id;
48-
this.previousStepsIncompleteModalWasDismissed = false;
49-
}
5022
}
5123

5224
declare module '@glint/environment-ember-loose/registry' {

0 commit comments

Comments
 (0)