remove '-' from tab name when given term is empty

This commit is contained in:
ucrhh 2021-03-01 12:32:36 +01:00
parent b282064f72
commit 0154e2ddf9

View File

@ -108,8 +108,13 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
private void onTypeInferButtonClick(Consumer<Pair<String, Map<String, String>>> callback) {
String currentInput = inputField.getOptionalValue().orElse(StringUtils.EMPTY);
inputField.blur();
UI.getCurrent().getPage().setTitle(getTranslation("root.typicalc") + " - " + currentInput);
if ("".equals(currentInput)) {
UI.getCurrent().getPage().setTitle(getTranslation("root.typicalc"));
} else {
UI.getCurrent().getPage().setTitle(getTranslation("root.typicalc") + " - " + currentInput);
}
callback.accept(Pair.of(currentInput, typeAssumptionsArea.getTypeAssumptions()));
}