mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Fix sendMessage string handling (fixes #138)
This commit is contained in:
@@ -206,12 +206,17 @@ export default class Session {
|
||||
|
||||
private _impl_sendMessage (
|
||||
namespace: string
|
||||
, message: object
|
||||
, message: {} | string
|
||||
, messageId: string) {
|
||||
|
||||
let error = false;
|
||||
|
||||
try {
|
||||
// Decode string messages
|
||||
if (typeof message === "string") {
|
||||
message = JSON.parse(message);
|
||||
}
|
||||
|
||||
this.createChannel(namespace);
|
||||
this.channelMap.get(namespace)!.send(message);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user