allow swal single button

This commit is contained in:
Kyle Spearrin 2018-11-14 15:45:03 -05:00
parent 8232a4c9c8
commit 1b9943a4c8
1 changed files with 4 additions and 1 deletions

View File

@ -226,9 +226,12 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
contentDiv.appendChild(textDiv);
}
const confirmed = await swal({
const confirmed = buttons.length > 1 ? await swal({
content: { element: contentDiv },
buttons: buttons,
}) : await (swal as any)({
content: { element: contentDiv },
button: buttons[0],
});
return confirmed;
}