File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ import { inject as service } from '@ember/service';
3
3
4
4
export default Route . extend ( {
5
5
flashMessages : service ( ) ,
6
+ redirector : service ( ) ,
6
7
7
8
redirect ( ) {
8
9
let crate = this . modelFor ( 'crate' ) ;
9
10
10
11
let documentation = crate . get ( 'documentation' ) ;
11
12
if ( documentation ) {
12
- window . location = documentation ;
13
+ this . redirector . redirectTo ( documentation ) ;
13
14
} else {
14
15
// Redirect to the crate's main page and show a flash error if
15
16
// no documentation is found
Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ import { inject as service } from '@ember/service';
3
3
4
4
export default Route . extend ( {
5
5
flashMessages : service ( ) ,
6
+ redirector : service ( ) ,
6
7
7
8
redirect ( ) {
8
9
let crate = this . modelFor ( 'crate' ) ;
9
10
10
11
let repository = crate . get ( 'repository' ) ;
11
12
if ( repository ) {
12
- window . location = repository ;
13
+ this . redirector . redirectTo ( repository ) ;
13
14
} else {
14
15
// Redirect to the crate's main page and show a flash error if
15
16
// no repository is found
You can’t perform that action at this time.
0 commit comments