mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
navigate to startpage when empty term is entered
This commit is contained in:
parent
7a689d12a9
commit
d4a6acbc07
@ -94,6 +94,11 @@ public class MainViewImpl extends AppLayout
|
||||
|
||||
private void setTermInURL(Pair<String, Map<String, String>> lambdaTermAndAssumptions) {
|
||||
String lambdaTerm = lambdaTermAndAssumptions.getLeft();
|
||||
if ("".equals(lambdaTerm)) {
|
||||
UI.getCurrent().getPage().getHistory().pushState(null, new Location(""));
|
||||
setContent(new StartPageView());
|
||||
return;
|
||||
}
|
||||
StringBuilder types = new StringBuilder();
|
||||
for (Map.Entry<String, String> type : lambdaTermAndAssumptions.getRight().entrySet()) {
|
||||
if (types.length() > 0) {
|
||||
|
@ -69,7 +69,9 @@ public class UpperBar extends HorizontalLayout {
|
||||
*/
|
||||
protected void typeInfer(Pair<String, Map<String, String>> termAndAssumptions) {
|
||||
setTermInURL.accept(termAndAssumptions);
|
||||
startInfer(termAndAssumptions.getLeft(), termAndAssumptions.getRight());
|
||||
if (!"".equals(termAndAssumptions.getLeft())) {
|
||||
startInfer(termAndAssumptions.getLeft(), termAndAssumptions.getRight());
|
||||
}
|
||||
}
|
||||
|
||||
private void startInfer(String term, Map<String, String> typeAssumptions) {
|
||||
|
Loading…
Reference in New Issue
Block a user