diff --git a/src/elements/Popups/NewActorPopup/NewActorPopup.tsx b/src/elements/Popups/NewActorPopup/NewActorPopup.tsx index cce7387..6c38d95 100644 --- a/src/elements/Popups/NewActorPopup/NewActorPopup.tsx +++ b/src/elements/Popups/NewActorPopup/NewActorPopup.tsx @@ -22,7 +22,7 @@ class NewActorPopup extends React.Component { } export class NewActorPopupContent extends React.Component { - value: string | undefined; + nameValue: string | undefined; render(): JSX.Element { return ( @@ -32,7 +32,7 @@ export class NewActorPopupContent extends React.Component { type='text' placeholder='Actor Name' onChange={(v): void => { - this.value = v.target.value; + this.nameValue = v.target.value; }} /> @@ -48,11 +48,11 @@ export class NewActorPopupContent extends React.Component { */ storeselection(): void { // check if user typed in name - if (this.value === '' || this.value === undefined) { + if (this.nameValue === '' || this.nameValue === undefined) { return; } - callAPI(APINode.Actor, {action: 'createActor', actorname: this.value}, (result: GeneralSuccess) => { + callAPI(APINode.Actor, {action: 'createActor', ActorName: this.nameValue}, (result: GeneralSuccess) => { if (result.result !== 'success') { console.log('error occured while writing to db -- todo error handling'); console.log(result.result); diff --git a/src/pages/Player/Player.tsx b/src/pages/Player/Player.tsx index 82c86f8..c929d7e 100644 --- a/src/pages/Player/Player.tsx +++ b/src/pages/Player/Player.tsx @@ -314,7 +314,12 @@ export class Player extends React.Component { * calls callback to viewbinding to show previous page agains */ closebtn(): void { - this.props.history.goBack(); + const hist = this.props.history; + if (hist.length > 1) { + this.props.history.goBack(); + } else { + hist.push('/'); + } } /**