Skip to content

Commit f1e831d

Browse files
committed
Use Redirector service instead of setting window.location
That makes the routes work under FastBoot.
1 parent da0389b commit f1e831d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/routes/crate/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default Route.extend({
99

1010
let documentation = crate.get('documentation');
1111
if (documentation) {
12-
window.location = documentation;
12+
this.redirector.redirectTo(documentation);
1313
} else {
1414
// Redirect to the crate's main page and show a flash error if
1515
// no documentation is found

app/routes/crate/repo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import { inject as service } from '@ember/service';
33

44
export default Route.extend({
55
flashMessages: service(),
6+
redirector: service(),
67

78
redirect() {
89
let crate = this.modelFor('crate');
910

1011
let repository = crate.get('repository');
1112
if (repository) {
12-
window.location = repository;
13+
this.redirector.redirectTo(repository);
1314
} else {
1415
// Redirect to the crate's main page and show a flash error if
1516
// no repository is found

0 commit comments

Comments
 (0)