Skip to content

Commit 1bdf846

Browse files
authored
A Promise should always resolve() or reject() (#26)
* A Promise should always resolve() or reject() * Additional fix
1 parent b29fee3 commit 1bdf846

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ document.addEventListener('DOMContentLoaded', () => {
106106
return Notification.requestPermission().then(result => {
107107
if (result !== 'granted') {
108108
reject(new Error('Bad permission result'));
109+
} else {
110+
resolve();
109111
}
110-
111-
resolve();
112112
});
113113
}
114+
115+
return reject(new Error('Unknown permission'));
114116
});
115117
}
116118

0 commit comments

Comments
 (0)