Skip to content

Commit

Permalink
chore(demo): hide code that changes production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-godoy authored and paodb committed Jun 4, 2024
1 parent a6c5935 commit bd317ee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public ErrorwindowDemo() {
new ErrorWindow(e, "CUSTOM ERROR MESSAGE", errorWindowI18n).open();
}
});


// #if vaadin eq 0
Checkbox productionModeCb = new Checkbox("Production Mode");
productionModeCb.setValue(getProductionMode());
productionModeCb.addValueChangeListener(
Expand All @@ -110,6 +111,7 @@ public ErrorwindowDemo() {
Notification.show(
"Currently production mode is: " + System.getProperty("productionMode"));
});
// #endif

Upload upload = new Upload(new NullMemoryBuffer());
upload.addSucceededListener(ev -> {
Expand Down Expand Up @@ -138,6 +140,7 @@ public ErrorwindowDemo() {

}

// #if vaadin eq 0
private boolean getProductionMode() {
return Optional.ofNullable(System.getProperty("errorWindowProductionMode"))
.map(Boolean::valueOf).orElseGet(() -> {
Expand All @@ -149,4 +152,5 @@ private boolean getProductionMode() {
private void setProductionMode(boolean mode) {
System.setProperty("errorWindowProductionMode", Boolean.toString(mode));
}
// #endif
}

0 comments on commit bd317ee

Please sign in to comment.