Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring load/unload of Cliqz modules, fix for GH-476. #8

Merged
merged 4 commits into from Mar 19, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Prev

Removing isReady.

  • Loading branch information
Serge Zarembsky
Serge Zarembsky committed Mar 19, 2018
commit 3297c98b84a2617a1a28ee4c5bf318315eda1c1c
@@ -87,7 +87,8 @@ function setCliqzModuleEnabled(module, enabled) {
return cliqz.enableModule(module.name);
} else if (!enabled && module.isEnabled) {
log('SET CLIQZ MODULE DISABLED', module);
return module.isReady().then(() => cliqz.disableModule(module.name));
cliqz.disableModule(module.name);
return Promise.resolve();

This comment has been minimized.

@jsignanini

jsignanini Mar 19, 2018
Member

Should this instead be return Promise.resolve(CORRECT_STATE);? @zarembsky

}
log('MODULE IS ALREADY IN CORRECT STATE', module, enabled);
return Promise.resolve(CORRECT_STATE);

This comment has been minimized.

@jsignanini

jsignanini Mar 19, 2018
Member

Let's add a few checks here to make sure the module parameter actually is indeed a fully qualified module object. Otherwise make the function fail gracefully.

ProTip! Use n and p to navigate between commits in a pull request.