Skip to content

Commit

Permalink
Merge pull request kitodo#5826 from effective-webwork/client-change
Browse files Browse the repository at this point in the history
Reload page on client change
  • Loading branch information
solth authored Nov 15, 2023
2 parents abd2194 + 6b071fc commit efa5917
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Objects;

import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;

import org.kitodo.data.database.beans.Client;
Expand Down Expand Up @@ -134,8 +135,12 @@ public void setSelectedClient(Client selectedClient) {
* @param sessionClient
* The client object that is to be the new session client.
*/
public void setSessionClient(Client sessionClient) {
public String setSessionClient(Client sessionClient) {
ServiceManager.getUserService().getAuthenticatedUser().setSessionClient(sessionClient);
if (Objects.nonNull(FacesContext.getCurrentInstance())) {
return FacesContext.getCurrentInstance().getViewRoot().getViewId();
}
return null;
}

/**
Expand Down

0 comments on commit efa5917

Please sign in to comment.