[chore-245] resolve "promise but void expected" error

This commit is contained in:
MathieuG-P
2023-07-16 15:28:37 +02:00
parent cac216c4eb
commit 928c816344
@@ -109,9 +109,10 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion;
const subs: Subscription[] = [];
if (isVisible && isOnline) {
const promise = new Promise<boolean>(async resolve => {
(async () => {
if (configService.get<boolean>(ACCEPTED_DISCLAIMER_KEY)) {
return resolve(true);
return true;
}
const res = await modals.openModal(ModsDisclaimerModal);
@@ -121,14 +122,14 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion;
configService.set(ACCEPTED_DISCLAIMER_KEY, true);
}
resolve(haveAccepted);
});
promise.then(canLoad => {
return haveAccepted;
})().then(canLoad => {
if (!canLoad) {
return onDisclamerDecline?.();
}
loadMods();
subs.push(
modsManager.isUninstalling$
.pipe(