Skip to content

Commit

Permalink
title : void title to initial title
Browse files Browse the repository at this point in the history
this and the last 3 commits fix #206
  • Loading branch information
n0mad01 committed Apr 3, 2019
1 parent e2a4d5c commit d5a7081
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/core/components/titlebar/titlebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export class TitlebarComponent implements OnInit {
.subscribe(
({project_title}) => {
let newTitle = this.pnform!.value!.project_title!
if(newTitle === '') {
newTitle = _PROJECT_DEFAULT_TITLE_
this.pnform!.patchValue({project_title: newTitle})
}
// reset document title
this.titleService.setTitle(newTitle);

Expand Down
2 changes: 1 addition & 1 deletion src/app/persistence/reducers/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export function reducer(state: State = initialState, action: project.Actions): S
return state.set('clipboard', all)
}
case project.PROJECT_UPDATE_TITLE: {
if (state.getIn(['meta', 'general'])!.title !== action!.payload!.title) {
if (state.getIn(['meta', 'general'])!.title !== action!.payload!.title || action!.payload!.title !== _PROJECT_DEFAULT_TITLE_) {
return state.setIn(['meta', 'general'], action.payload)
}
return state
Expand Down

0 comments on commit d5a7081

Please sign in to comment.