Skip to content

Commit c2c516c

Browse files
committed
Add OnlineSpace feature and improve view model handling
- Introduced `MyViewModel` in `App.xaml.cs` for direct access to `HomePageVM`. - Updated `AppShell` to include a new tab for `OnlineSpaceD` and registered new routes. - Enhanced `SongsManagementService` with nullable reference types and collection initializers. - Streamlined data handling in `HomePageVM` and improved user interaction logic. - Refined `ChatService` for better chat message and friend request management. - Improved drag-and-drop operations in `MainPageD`, `PlaylistsPageD`, and `SingleSongShellPageD`. - Added `OnlineSpaceD` for online interactions and chat functionality. - Updated `DimmerWindow` initialization and user interaction handling. - Enhanced project structure in `ParseLiveQuery.csproj` and improved WebSocket handling in `ParseLiveQueryClient.cs`.
1 parent 54fcac9 commit c2c516c

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

ParseLiveQuery/Parse/Infrastructure/Control/ParseSetOperation.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public object ConvertToJSON(IServiceHub serviceHub = default)
3535
return dictionary;
3636
}
3737

38+
if (Value == null)
39+
{
40+
return null;
41+
}
3842
// Default behavior for unsupported types
3943
throw new ArgumentException($"Unsupported type for encoding: {Value?.GetType()?.FullName}");
4044
}

ParseLiveQuery/Parse/Infrastructure/Execution/ParseCommandRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public async Task<Tuple<HttpStatusCode, IDictionary<string, object>>> RunCommand
9797
}
9898
else if (responseCode == 404)
9999
{
100-
throw new ParseFailureException(ParseFailureException.ErrorCode.ERROR404, "Error 404");
100+
throw new ParseFailureException(ParseFailureException.ErrorCode.ERROR404, "Error 404 " +response.Item1+ response.Item2);
101101
}
102102
if (responseCode == 410)
103103
{

ParseLiveQuery/ParseLiveQuery.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,4 @@
4242
<PackageReadmeFile>ReleaseNotes.md</PackageReadmeFile>
4343
</PropertyGroup>
4444

45-
<ItemGroup>
46-
<None Include="..\LICENSE">
47-
<Pack>True</Pack>
48-
<PackagePath></PackagePath>
49-
</None>
50-
</ItemGroup>
51-
52-
53-
5445
</Project>

ParseLiveQuery/ParseLiveQueryClient.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,17 @@ public Subscription<T> Subscribe<T>(ParseQuery<T> query, string SubscriptionName
143143
_subscriptions.TryAdd(requestId, subscription);
144144

145145
// Handle cases
146-
if (IsConnected)
146+
if (!IsConnected)
147147
{
148-
SendSubscription(subscription);
148+
ConnectIfNeeded();
149149
}
150150
else if (_userInitiatedDisconnect)
151151
{
152152
throw new InvalidOperationException("The client was explicitly disconnected and must be reconnected before subscribing");
153153
}
154-
else
155-
{
156-
ConnectIfNeeded();
157-
}
154+
155+
SendSubscription(subscription);
156+
158157
return subscription;
159158
}
160159

@@ -170,6 +169,7 @@ public void ConnectIfNeeded()
170169
break;
171170
case WebSocketClientState.Connecting:
172171
case WebSocketClientState.Connected:
172+
_hasReceivedConnected=true;
173173
break;
174174
default:
175175
break;
@@ -248,6 +248,10 @@ public void Reconnect()
248248
_hasReceivedConnected = false;
249249
_webSocketClient = _webSocketClientFactory(_hostUri, new WebSocketClientCallback(this)); // Pass callback here
250250
_webSocketClient.Open();
251+
if (_webSocketClient.State == WebSocketState.Open)
252+
{
253+
_hasReceivedConnected=true;
254+
}
251255
}
252256

253257

0 commit comments

Comments
 (0)