Fix managed iOS native media linking
This commit is contained in:
@@ -98,6 +98,11 @@ internal sealed class AppModel
|
||||
Status = restoring ? "Reconnecting…" : "Connecting…"; Notify();
|
||||
lifetime?.Cancel(); lifetime?.Dispose(); lifetime = new();
|
||||
VoiceCatClient next = new("VoiceCat-iOS", "0.0.1", storage.TofuPath);
|
||||
next.ConnectionStateChanged += state =>
|
||||
{
|
||||
if (state == ClientConnectionState.Disconnected && next.ConnectionFailure is { } failure)
|
||||
Console.Error.WriteLine($"VoiceCat control connection failed: {failure}");
|
||||
};
|
||||
client = next;
|
||||
try
|
||||
{
|
||||
@@ -118,8 +123,10 @@ internal sealed class AppModel
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
IsConnecting = false; Status = exception.Message; Notify();
|
||||
System.Diagnostics.Debug.WriteLine($"Connection failed: {exception}");
|
||||
IsConnecting = false; Status = exception.Message;
|
||||
await next.DisposeAsync(); if (ReferenceEquals(client, next)) client = null;
|
||||
Notify();
|
||||
if (restoring && !explicitDisconnect) ScheduleReconnect();
|
||||
else throw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user