Skip to content

Commit 19bf215

Browse files
author
Fatme
authored
Merge pull request #3949 from NativeScript/fatme/generate-qr-code
chore: generate QR code when env is not properly configured
2 parents c61f101 + 6aefbbb commit 19bf215

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/services/platform-environment-requirements.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
1212
private $prompter: IPrompter,
1313
private $staticConfig: IStaticConfig,
1414
private $analyticsService: IAnalyticsService,
15-
private $injector: IInjector) { }
15+
private $injector: IInjector,
16+
private $playgroundQrCodeGenerator: IPlaygroundQrCodeGenerator) { }
1617

1718
@cache()
1819
private get $previewCommandHelper(): IPreviewCommandHelper {
@@ -198,6 +199,8 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
198199
timeout: options.timeout,
199200
useHotModuleReload: options.hmr
200201
});
202+
203+
await this.$playgroundQrCodeGenerator.generateQrCodeForCurrentApp({ useHotModuleReload: options.hmr });
201204
}
202205
}
203206

test/services/platform-environment-requirements.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function createTestInjector() {
2828
testInjector.register("platformEnvironmentRequirements", PlatformEnvironmentRequirements);
2929
testInjector.register("staticConfig", { SYS_REQUIREMENTS_LINK: "" });
3030
testInjector.register("nativeScriptCloudExtensionService", {});
31+
testInjector.register("playgroundQrCodeGenerator", {});
3132

3233
return testInjector;
3334
}

0 commit comments

Comments
 (0)