1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Preventing save with empty yaml

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-09-28 14:49:26 +03:00
parent 3080c25c81
commit cb4f47e18d

View File

@ -39,6 +39,7 @@ export class CreateResource extends React.Component<Props> {
create = async () => {
if (this.error) return;
if (!this.data.trim()) return; // do not save when field is empty
const resources = jsYaml.safeLoadAll(this.data)
.filter(v => !!v) // skip empty documents if "---" pasted at the beginning or end
const createdResources: string[] = [];