Skip to content

Commit

Permalink
Merge pull request #2829 from SCADA-LTS/fix/#1075_Reset_the_view_name…
Browse files Browse the repository at this point in the history
…_after_loading_the_background_file

#1075 Reset the view name after loading the background file
  • Loading branch information
Limraj authored Feb 28, 2024
2 parents adc2bd8 + d742afa commit 556c4ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/com/serotonin/mango/util/ViewControllerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.serotonin.mango.Common;
import com.serotonin.mango.view.View;
import org.scada_lts.mango.service.ViewService;
import org.scada_lts.serorepl.utils.StringUtils;
import org.scada_lts.utils.HttpParameterUtils;

import javax.servlet.http.HttpServletRequest;
Expand All @@ -18,6 +19,10 @@ public static View getOrEmptyView(HttpServletRequest request, ViewService viewSe
if(view == null) {
view = HttpParameterUtils.getObject("emptyView", request, View.class).orElseGet(View::new);
}
String viewName = HttpParameterUtils.getValue("view.name", request, a -> a).orElse("");
if(!StringUtils.isEmpty(viewName)) {
view.setName(viewName);
}
return view;
}

Expand Down

0 comments on commit 556c4ef

Please sign in to comment.