player page: goback only if backstack available, go to homepage if not

fix invalid api request when creating new actor
This commit is contained in:
2021-08-28 22:21:51 +02:00
parent 032b90a93d
commit f8dbadc45b
2 changed files with 10 additions and 5 deletions

View File

@ -314,7 +314,12 @@ export class Player extends React.Component<Props, mystate> {
* 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('/');
}
}
/**