web/admin: fix error when copying token while none exist
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
2cde40aeee
commit
ea2dbb2f33
|
@ -29,8 +29,8 @@ export class TokenCopyButton extends ActionButton {
|
||||||
this.buttonClass = PRIMARY_CLASS;
|
this.buttonClass = PRIMARY_CLASS;
|
||||||
}, 1500);
|
}, 1500);
|
||||||
});
|
});
|
||||||
}).catch((err: Response) => {
|
}).catch((err: Response | undefined) => {
|
||||||
return err.json().then(errResp => {
|
return err?.json().then(errResp => {
|
||||||
throw new Error(errResp["detail"]);
|
throw new Error(errResp["detail"]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Reference in New Issue