kopia lustrzana https://gitlab.com/rysiekpl/libresilient
service-worker: basic implementation of config.enabled flag (ref. #45)
rodzic
9eecbe37e5
commit
748dead637
|
@ -279,6 +279,13 @@ let initServiceWorker = async () => {
|
|||
|
||||
do {
|
||||
|
||||
// if the plugin is not enabled, no instantiation for it nor for its dependencies
|
||||
// if the pluginConfig does not have an "enabled" field, it should be assumed to be "true"
|
||||
if ( ( "enabled" in pluginConfig ) && ( pluginConfig.enabled != true ) ) {
|
||||
self.log('service-worker', `skipping ${pluginConfig.name} instantiation: plugin not enabled (dependencies will also not be instantiated)`)
|
||||
break;
|
||||
}
|
||||
|
||||
// instantiate the plugin
|
||||
let plugin = LibResilientPluginConstructors.get(pluginConfig.name)(self, pluginConfig)
|
||||
self.log('service-worker', `${pluginConfig.name}: instantiated`)
|
||||
|
|
Ładowanie…
Reference in New Issue