Skip to content

Commit

Permalink
fix: set legacy event format for any known message contents
Browse files Browse the repository at this point in the history
  • Loading branch information
bennealon committed Nov 15, 2024
1 parent ee4921f commit d3c3432
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/LegacyHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const translateLegacyImageStudioEvent = (
}

if (eventData?.disconnect) {
setUsingLegacyEventFormat(true);
console.warn('[LEGACY] translating disconnect message');
return {
type: ImageStudioEventType.Disconnect,
Expand All @@ -48,14 +49,14 @@ export const translateLegacyImageStudioEvent = (
}

if (eventData?.exportImageInfo) {
setUsingLegacyEventFormat(true);
console.warn('[LEGACY] translating exportImageInfo message');
return {
type: ImageStudioEventType.ImageSave,
data: { image: eventData.exportImageInfo },
};
}

console.warn(`[LEGACY] unknown message during translation: ${eventData}`);
return null;
};

Expand Down

0 comments on commit d3c3432

Please sign in to comment.