Skip to content

Commit

Permalink
display status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-luger committed Oct 2, 2024
1 parent c6fffdb commit 4f123ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/WebsocketHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ function initWebsocket(): void {
let _handleRequestOnMessage = function (response: ApiResponse, request: ApiRequest) {
let equals = findForEqualSentRequest(request)

if (response.type === 'display') {
if (typeof toast[response.data.type] === 'function') {
toast[response.data.type](response.data.message)
} else {
toast.info(response.data.message)
}
return
}

if (response.type.includes('error')) {
request.reject(JSON.parse(response.data))
equals.forEach(equal => equal.reject(JSON.parse(response.data)))
Expand Down

0 comments on commit 4f123ba

Please sign in to comment.