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(
43
43
44
44
internal fun Analytics.update (settings : Settings , type : Plugin .UpdateType ) {
45
45
timeline.applyClosure { plugin ->
46
- if (plugin is DestinationPlugin ) {
47
- plugin.enabled = settings.hasIntegrationSettings(plugin)
48
- }
49
46
// tell all top level plugins to update.
50
47
// For destination plugins they auto-handle propagation to sub-plugins
51
48
plugin.update(settings, type)
Original file line number Diff line number Diff line change @@ -93,7 +93,12 @@ abstract class DestinationPlugin : EventPlugin {
93
93
timeline.remove(plugin)
94
94
}
95
95
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
+ */
96
100
override fun update (settings : Settings , type : Plugin .UpdateType ) {
101
+ enabled = settings.hasIntegrationSettings(this )
97
102
// Apply settings update to its own plugins
98
103
timeline.applyClosure {
99
104
it.update(settings, type)
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class SegmentDestination : DestinationPlugin() {
101
101
}
102
102
103
103
override fun update (settings : Settings , type : Plugin .UpdateType ) {
104
+ super .update(settings, type)
104
105
if (settings.hasIntegrationSettings(this )) {
105
106
settings.destinationSettings<SegmentSettings >(key)?.let {
106
107
pipeline.apiHost = it.apiHost
You can’t perform that action at this time.
0 commit comments