Only listen for events on existing sites
This commit is contained in:
parent
1ecd008824
commit
700156cf64
|
@ -93,6 +93,7 @@ class Site {
|
|||
this.rawConfig = rawConfig;
|
||||
this.lastManagedUpdate = lastManagedUpdate;
|
||||
|
||||
if (id != null) {
|
||||
_updates = EventChannel('net.defined.nebula/$id');
|
||||
_updates.receiveBroadcastStream().listen((d) {
|
||||
try {
|
||||
|
@ -108,6 +109,7 @@ class Site {
|
|||
_change.addError(error.message ?? 'An unexpected error occurred');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
factory Site.fromJson(Map<String, dynamic> json) {
|
||||
var decoded = Site._fromJson(json);
|
||||
|
|
Loading…
Reference in New Issue