show back button also in install client screen

This commit is contained in:
Bruno Windels 2020-12-07 14:18:19 +01:00
parent 1896fde3a0
commit e13c943d3f
2 changed files with 11 additions and 10 deletions

View file

@ -57,11 +57,7 @@ class OpenClientView extends TemplateView {
rel: "noopener noreferrer", rel: "noopener noreferrer",
onClick: () => vm.deepLinkActivated(), onClick: () => vm.deepLinkActivated(),
}, "Continue"), }, "Continue"),
t.p({className: {previewSource: true, hidden: vm => !vm.showBack}}, [ showBack(t, vm),
`Continue with ${vm.name}.`,
" ",
t.button({className: "text", onClick: () => vm.back()}, "Change"),
]),
]); ]);
} }
} }
@ -117,12 +113,16 @@ class InstallClientView extends TemplateView {
children.push(t.p([`If you already have ${vm.name} installed, you can `, deepLink, "."])) children.push(t.p([`If you already have ${vm.name} installed, you can `, deepLink, "."]))
} }
children.push(t.p({className: {previewSource: true, hidden: vm => !vm.showBack}}, [ children.push(showBack(t, vm));
`Continue with ${vm.name}.`,
" ",
t.button({className: "text", onClick: () => vm.back()}, "Change"),
]));
return t.div({className: "InstallClientView"}, children); return t.div({className: "InstallClientView"}, children);
} }
} }
function showBack(t, vm) {
return t.p({className: {previewSource: true, hidden: vm => !vm.showBack}}, [
`Continue with ${vm.name}.`,
" ",
t.button({className: "text", onClick: () => vm.back()}, "Change"),
]);
}

View file

@ -163,6 +163,7 @@ export class ClientViewModel extends ViewModel {
} }
get showBack() { get showBack() {
// if we're not only showing this client, don't show back (see pick())
return !!this._clientListViewModel; return !!this._clientListViewModel;
} }