Skip to content

Commit ff57f01

Browse files
committed
Code review of fix re "internal error"
Related issue: uBlockOrigin/uBOL-home#199
1 parent 687475e commit ff57f01

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: platform/mv3/extension/js/background.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,14 @@ async function start() {
388388

389389
// https://github.com/uBlockOrigin/uBOL-home/issues/199
390390
// Force a restart of the extension once when an "internal error" occurs
391-
try {
392-
start();
391+
start().then(( ) => {
393392
localWrite({ goodStart: true });
394-
} catch(reason) {
393+
}).catch(reason => {
395394
console.trace(reason);
396-
localRead.get('goodStart').then((bin = {}) => {
397-
if ( bin.goodStart !== true ) { return; }
395+
localRead('goodStart').then((bin = {}) => {
396+
if ( bin.goodStart === false ) { return; }
398397
localWrite({ goodStart: false }).then(( ) => {
399398
runtime.reload();
400399
});
401400
});
402-
}
401+
});

0 commit comments

Comments
 (0)