Skip to content

Commit 5e6731b

Browse files
committed
feat: update notification on CallType changed
1 parent c25f5e6 commit 5e6731b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/src/method_channel/web_callkit_method_channel.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -811,14 +811,17 @@ class MethodChannelWebCallkit extends WebCallkitPlatform {
811811
required CallType callType,
812812
ActionSource source = ActionSource.notification,
813813
}) {
814-
printDebug("Call type changed: ${result.uuid}", tag: tag);
815-
// TODO - check all call states
816-
final call = _callManager.getCall(result.uuid);
817-
if (call != null) {
818-
final event = CallEvent.update(call);
819-
_onCallTypeChangeListener?.call(event, callType, source);
820-
} else {
821-
printDebug("_onCallTypeChange: Call not found: ${result.uuid}", tag: tag);
814+
if (result.uuid != null) {
815+
final uuid = result.uuid!;
816+
printDebug("Call type changed: ${result.uuid}", tag: tag);
817+
// TODO - check all call states
818+
final call = _callManager.getCall(uuid);
819+
if (call != null) {
820+
final event = CallEvent.update(call);
821+
_onCallTypeChangeListener?.call(event, callType, source);
822+
} else {
823+
printDebug("_onCallTypeChange: Call not found: $uuid}", tag: tag);
824+
}
822825
}
823826
}
824827

0 commit comments

Comments
 (0)