File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
templates/flutter/lib/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -132,12 +132,12 @@ mixin RealtimeMixin {
132
132
StreamController<RealtimeMessage > controller = StreamController.broadcast();
133
133
_channels.addAll(channels);
134
134
Future.delayed(Duration.zero, () => _createSocket());
135
- int counter = _subscriptionsCounter++ ;
135
+ int id = DateTime.now().microsecondsSinceEpoch ;
136
136
RealtimeSubscription subscription = RealtimeSubscription(
137
137
controller: controller,
138
138
channels: channels,
139
139
close: () async {
140
- _subscriptions.remove(counter );
140
+ _subscriptions.remove(id );
141
141
_subscriptionsCounter--;
142
142
controller.close();
143
143
_cleanup(channels);
@@ -148,7 +148,7 @@ mixin RealtimeMixin {
148
148
await _closeConnection();
149
149
}
150
150
});
151
- _subscriptions[counter ] = subscription;
151
+ _subscriptions[id ] = subscription;
152
152
return subscription;
153
153
}
154
154
You can’t perform that action at this time.
0 commit comments