Fix promise return values

This commit is contained in:
Cory LaViska
2021-01-04 14:11:23 -05:00
parent 9f7d4be683
commit a2c25acfd9
2 changed files with 3 additions and 3 deletions

View File

@@ -126,7 +126,7 @@ export class Alert {
*/
@Method()
async toast() {
return new Promise(resolve => {
return new Promise<void>(resolve => {
if (!toastStack.parentElement) {
document.body.append(toastStack);
}

View File

@@ -224,12 +224,12 @@ export class ColorPicker {
async reportValidity() {
// If the input is invalid, show the dropdown so the browser can focus on it
if (!this.inline && this.input.invalid) {
return new Promise(resolve => {
return new Promise<void>(resolve => {
this.dropdown.addEventListener(
'sl-after-show',
() => {
this.input.reportValidity();
resolve(null);
resolve();
},
{ once: true }
);