Skip to content

Commit

Permalink
Merge pull request #1513 from codecrafters-io/dependabot/npm_and_yarn…
Browse files Browse the repository at this point in the history
…/ember-types-da15ae5442

chore(deps-dev): bump the ember-types group with 2 updates
  • Loading branch information
rohitpaulk committed Aug 14, 2024
2 parents e83f62d + e474dac commit 5ac649a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/routes/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class CourseRoute extends BaseRoute {
}

redirect(_model: ModelType, transition: Transition) {
if (transition.to.name === 'course.index') {
if (transition.to?.name === 'course.index') {
const activeStep = this.coursePageState.stepListAsStepList.activeStep;

// @ts-ignore not sure if we need to handle nullity here
Expand Down
2 changes: 1 addition & 1 deletion app/routes/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class VoteRoute extends BaseRoute {
}

afterModel(_model: ModelType, transition: Transition) {
if (transition.to.name === 'vote.index') {
if (transition.to?.name === 'vote.index') {
this.router.transitionTo('vote.course-ideas');
}
}
Expand Down
10 changes: 5 additions & 5 deletions app/utils/base-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export default class BaseRoute extends Route {
}

if (!this.allowsAnonymousAccess && !this.authenticator.isAuthenticated) {
const params = paramsFromRouteInfo(transition.to);
const params = transition.to ? paramsFromRouteInfo(transition.to) : [];

if (params.length > 0) {
const paramValues = params.map(([_, value]) => value);
this.authenticator.initiateLogin(this.router.urlFor(transition.to.name, ...paramValues));
this.authenticator.initiateLogin(this.router.urlFor(transition.to?.name || 'catalog', ...paramValues));
} else {
this.authenticator.initiateLogin(this.router.urlFor(transition.to.name));
this.authenticator.initiateLogin(this.router.urlFor(transition.to?.name || 'catalog'));
}

transition.abort();
Expand All @@ -44,9 +44,9 @@ export default class BaseRoute extends Route {
}
}

const queryParams = transition.to.queryParams;
const queryParams = transition.to?.queryParams;

if (queryParams['r'] && /^\d[a-zA-Z][a-zA-Z]$/.test(queryParams['r'])) {
if (queryParams && queryParams['r'] && /^\d[a-zA-Z][a-zA-Z]$/.test(queryParams['r'])) {
// @ts-ignore
this.utmCampaignIdTracker.setCampaignId(queryParams['r']);
delete queryParams['r'];
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@
"@types/ember__error": "^4.0.6",
"@types/ember__object": "^4.0.12",
"@types/ember__polyfills": "^4.0.6",
"@types/ember__routing": "^4.0.21",
"@types/ember__routing": "^4.0.22",
"@types/ember__runloop": "^4.0.10",
"@types/ember__service": "^4.0.9",
"@types/ember__string": "^3.0.15",
"@types/ember__template": "^4.0.6",
"@types/ember__template": "^4.0.7",
"@types/ember__test": "^4.0.6",
"@types/ember__test-helpers": "^2.9.1",
"@types/ember__utils": "^4.0.7",
Expand Down

0 comments on commit 5ac649a

Please sign in to comment.