Skip to content

Commit dce6024

Browse files
committed
remove guide.live_preview_updated event
1 parent a141202 commit dce6024

2 files changed

Lines changed: 2 additions & 23 deletions

File tree

packages/client/src/clients/guide/client.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
GuideData,
3131
GuideGroupAddedEvent,
3232
GuideGroupUpdatedEvent,
33-
GuideLivePreviewUpdatedEvent,
3433
GuideRemovedEvent,
3534
GuideSocketEvent,
3635
GuideStepData,
@@ -194,7 +193,6 @@ export class KnockGuideClient {
194193
"guide.removed",
195194
"guide_group.added",
196195
"guide_group.updated",
197-
"guide.live_preview_updated",
198196
];
199197
private subscribeRetryCount = 0;
200198

@@ -447,9 +445,6 @@ export class KnockGuideClient {
447445
case "guide_group.updated":
448446
return this.addOrReplaceGuideGroup(payload);
449447

450-
case "guide.live_preview_updated":
451-
return this.updatePreviewGuide(payload);
452-
453448
default:
454449
return;
455450
}
@@ -1261,15 +1256,6 @@ export class KnockGuideClient {
12611256
});
12621257
}
12631258

1264-
private updatePreviewGuide({ data }: GuideLivePreviewUpdatedEvent) {
1265-
const guide = this.localCopy(data.guide);
1266-
1267-
this.store.setState((state) => {
1268-
const previewGuides = { ...state.previewGuides, [guide.key]: guide };
1269-
return { ...state, previewGuides };
1270-
});
1271-
}
1272-
12731259
// Define as an arrow func property to always bind this to the class instance.
12741260
private handleLocationChange = () => {
12751261
this.knock.log(`[Guide] .handleLocationChange`);

packages/client/src/clients/guide/types.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ type SocketEventType =
161161
| "guide.updated"
162162
| "guide.removed"
163163
| "guide_group.added"
164-
| "guide_group.updated"
165-
| "guide.live_preview_updated";
164+
| "guide_group.updated";
166165

167166
type SocketEventPayload<E extends SocketEventType, D> = {
168167
topic: string;
@@ -195,18 +194,12 @@ export type GuideGroupUpdatedEvent = SocketEventPayload<
195194
{ guide_group: GuideGroupData }
196195
>;
197196

198-
export type GuideLivePreviewUpdatedEvent = SocketEventPayload<
199-
"guide.live_preview_updated",
200-
{ guide: GuideData; eligible: boolean }
201-
>;
202-
203197
export type GuideSocketEvent =
204198
| GuideAddedEvent
205199
| GuideUpdatedEvent
206200
| GuideRemovedEvent
207201
| GuideGroupAddedEvent
208-
| GuideGroupUpdatedEvent
209-
| GuideLivePreviewUpdatedEvent;
202+
| GuideGroupUpdatedEvent;
210203

211204
//
212205
// Guide client

0 commit comments

Comments
 (0)