mirror of https://github.com/status-im/consul.git
Transition to exported/imported based on peer type
This commit is contained in:
parent
991bc5a6cd
commit
8b962b5c30
|
@ -0,0 +1,15 @@
|
|||
import Controller from "@ember/controller";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default class DcPeersEditIndexController extends Controller {
|
||||
@service router;
|
||||
|
||||
@action transitionToStartSubRouteByType(peerModel) {
|
||||
if (peerModel.isDialer) {
|
||||
this.router.replaceWith("dc.peers.edit.exported");
|
||||
} else {
|
||||
this.router.replaceWith("dc.peers.edit.imported");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,3 @@
|
|||
<Route
|
||||
@name={{routeName}}
|
||||
as |route|>
|
||||
{{did-insert (route-action 'replaceWith' 'dc.peers.edit.addresses')}}
|
||||
</Route>
|
||||
|
||||
<Route @name={{routeName}} as |route|>
|
||||
{{did-insert (fn this.transitionToStartSubRouteByType route.model.peer)}}
|
||||
</Route>
|
Loading…
Reference in New Issue