Skip to content

Commit

Permalink
#146 set proper target name
Browse files Browse the repository at this point in the history
  • Loading branch information
matej-vavrek authored and tibor-postek-m2ms committed Mar 10, 2020
1 parent 049fed7 commit cb7a766
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/components/session/withSnapshotManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const withSnapshotManagement = WrappedComponent => {
const nextUuid = useSelector(state => state.snapshotReducers.nextUuid);
const loadedSession = useSelector(state => state.snapshotReducers.loadedSession);
const targetIdList = useSelector(state => state.apiReducers.target_id_list);
const targetName = useSelector(state => state.apiReducers.target_on_name);

const disableButtons =
(savingState &&
Expand All @@ -51,8 +52,8 @@ export const withSnapshotManagement = WrappedComponent => {

// Function for set Header buttons, target title and snackBar information about session
useEffect(() => {
if (targetIdList[0] !== undefined) {
setHeaderNavbarTitle(targetIdList[0].title);
if (targetName !== undefined) {
setHeaderNavbarTitle(targetName);
}
setHeaderButtons([
<Button
Expand Down Expand Up @@ -82,6 +83,7 @@ export const withSnapshotManagement = WrappedComponent => {
setHeaderButtons,
setSnackBarTitle,
targetIdList,
targetName,
setSnackBarColor
]);

Expand Down

0 comments on commit cb7a766

Please sign in to comment.