the browser-facing portion of osu!

Merge pull request #11475 from nanaya/chat-response-empty

Fix chat update response when empty

authored by

bakaneko and committed by
GitHub
9586cde7 d481361f

+2 -5
+1 -3
app/Http/Controllers/Chat/ChatController.php
··· 272 272 $response['messages'] = []; 273 273 } 274 274 275 - $hasAny = array_first($response, fn ($val) => count($val) > 0) !== null; 276 - 277 - return $hasAny ? $response : response()->noContent(); 275 + return $response; 278 276 } 279 277 280 278 private function getSilences(?int $lastHistoryId, ?int $since)
+1 -1
resources/js/chat/chat-api.ts
··· 78 78 includes: ['presence', 'silences'], 79 79 since, 80 80 }, 81 - ) as JQuery.jqXHR<ChatUpdatesJson | null>; 81 + ) as JQuery.jqXHR<ChatUpdatesJson>; 82 82 } 83 83 84 84 export function joinChannel(channelId: number, userId: number) {
-1
resources/js/chat/chat-state-store.ts
··· 295 295 @action 296 296 private async updateChannelList() { 297 297 const json = await getUpdates(this.channelStore.lastReceivedMessageId, this.lastHistoryId); 298 - if (!json) return; // FIXME: fix response 299 298 300 299 runInAction(() => { 301 300 const newHistoryId = maxBy(json.silences, 'id')?.id;