mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 09:39:58 +00:00
Reformat extension message definitions
This commit is contained in:
@@ -88,10 +88,10 @@ export default class Media {
|
||||
}
|
||||
|
||||
private sendMessage (subject: string, data: any) {
|
||||
data._id = this.referenceId;
|
||||
(sendMessage as any)({
|
||||
subject
|
||||
, data
|
||||
, _id: this.referenceId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,11 +168,11 @@ export default class Session {
|
||||
}
|
||||
|
||||
private sendMessage (subject: string, data: any = {}) {
|
||||
data._id = this.referenceId;
|
||||
sendMessage({
|
||||
// @ts-ignore
|
||||
subject
|
||||
, data
|
||||
, _id: this.referenceId
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@ const existingSessions: Map<string, Session> = new Map();
|
||||
const existingMedia: Map<string, Media> = new Map();
|
||||
|
||||
export function handleSessionMessage (message: any) {
|
||||
if (!message._id) {
|
||||
if (!message.data._id) {
|
||||
console.error("Session message missing _id");
|
||||
return;
|
||||
}
|
||||
|
||||
const sessionId = message._id;
|
||||
const sessionId = message.data._id;
|
||||
|
||||
if (existingSessions.has(sessionId)) {
|
||||
// Forward message to instance message handler
|
||||
@@ -35,12 +35,12 @@ export function handleSessionMessage (message: any) {
|
||||
}
|
||||
|
||||
export function handleMediaMessage (message: any) {
|
||||
if (!message._id) {
|
||||
if (!message.data._id) {
|
||||
console.error("Media message missing _id");
|
||||
return;
|
||||
}
|
||||
|
||||
const mediaId = message._id;
|
||||
const mediaId = message.data._id;
|
||||
|
||||
if (existingMedia.has(mediaId)) {
|
||||
// Forward message to instance message handler
|
||||
|
||||
Reference in New Issue
Block a user