Skip to content

Commit fc74281

Browse files
Merge pull request #4734 from NativeScript/fatme/fix-preview-sync-hook
fix: fix the workflow of preview-sync hook
2 parents e5f9d45 + 6a565cf commit fc74281

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/controllers/preview-app-controller.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Device, FilesPayload } from "nativescript-preview-sdk";
22
import { TrackActionNames, PREPARE_READY_EVENT_NAME } from "../constants";
33
import { PrepareController } from "./prepare-controller";
44
import { performanceLog } from "../common/decorators";
5-
import { stringify, hook } from "../common/helpers";
5+
import { stringify } from "../common/helpers";
66
import { HmrConstants } from "../common/constants";
77
import { EventEmitter } from "events";
88
import { PrepareDataService } from "../services/prepare-data-service";
@@ -27,7 +27,6 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon
2727
private $prepareDataService: PrepareDataService
2828
) { super(); }
2929

30-
@hook("preview-sync")
3130
public async startPreview(data: IPreviewAppLiveSyncData): Promise<IQrCodeImageData> {
3231
await this.previewCore(data);
3332

@@ -61,6 +60,8 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon
6160
});
6261
}
6362

63+
await this.$hooksService.executeBeforeHooks("preview-sync", { ...data, platform: device.platform });
64+
6465
if (data.useHotModuleReload) {
6566
this.$hmrStatusService.attachToHmrStatusEvent();
6667
}

0 commit comments

Comments
 (0)