Skip to content

Commit a79442c

Browse files
committed
.NET TUI + WinForms | Make sure ditto.TransportConfig is updated via the UpdateTransportConfig helper
1 parent 40b1545 commit a79442c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dotnet-tui/DittoDotNetTasksConsole/DittoDotNetTasksConsole.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Ditto" Version="4.10.0" />
11+
<PackageReference Include="Ditto" Version="4.11.0-preview.4" />
1212
<PackageReference Include="Terminal.Gui" Version="1.17.1" />
1313
</ItemGroup>
1414

dotnet-tui/DittoDotNetTasksConsole/TasksPeer.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ public TasksPeer(string appId, string playgroundToken, string authUrl, string we
7373
authUrl);
7474

7575
ditto = new Ditto(identity, tempDir);
76-
77-
// Optionally enable all P2P transports if using P2P Sync
78-
// Do not call this if only using Ditto Cloud Sync
79-
ditto.TransportConfig.EnableAllPeerToPeer();
80-
81-
// Add the websocket URL to the transport configuration.
82-
ditto.TransportConfig.Connect.WebsocketUrls.Add(websocketUrl);
76+
77+
ditto.UpdateTransportConfig(config => {
78+
// Optionally enable all P2P transports if using P2P Sync
79+
// Do not call this if only using Ditto Cloud Sync
80+
config.EnableAllPeerToPeer();
81+
82+
// Add the websocket URL to the transport configuration.
83+
config.Connect.WebsocketUrls.Add(websocketUrl);
84+
});
8385

8486
// disable sync with v3 peers, required for DQL
8587
ditto.DisableSyncWithV3();

0 commit comments

Comments
 (0)