File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
core/src/main/java/com/segment/analytics/kotlin/core Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,6 @@ data class Settings(
4343
4444internal fun Analytics.update (settings : Settings , type : Plugin .UpdateType ) {
4545 timeline.applyClosure { plugin ->
46- if (plugin is DestinationPlugin ) {
47- plugin.enabled = settings.hasIntegrationSettings(plugin)
48- }
4946 // tell all top level plugins to update.
5047 // For destination plugins they auto-handle propagation to sub-plugins
5148 plugin.update(settings, type)
Original file line number Diff line number Diff line change @@ -93,7 +93,12 @@ abstract class DestinationPlugin : EventPlugin {
9393 timeline.remove(plugin)
9494 }
9595
96+ /* *
97+ * Update `enabled` state of destination and apply settings update to destination timeline
98+ * We recommend calling `super.update(..., ...) in case this function is overridden
99+ */
96100 override fun update (settings : Settings , type : Plugin .UpdateType ) {
101+ enabled = settings.hasIntegrationSettings(this )
97102 // Apply settings update to its own plugins
98103 timeline.applyClosure {
99104 it.update(settings, type)
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class SegmentDestination : DestinationPlugin() {
101101 }
102102
103103 override fun update (settings : Settings , type : Plugin .UpdateType ) {
104+ super .update(settings, type)
104105 if (settings.hasIntegrationSettings(this )) {
105106 settings.destinationSettings<SegmentSettings >(key)?.let {
106107 pipeline.apiHost = it.apiHost
You can’t perform that action at this time.
0 commit comments