Skip to content

Commit f50c20e

Browse files
author
Fatme
authored
Merge pull request NativeScript#4015 from NativeScript/fatme/fix-hmr-no-platform
fix: sync on all platforms when `tns run --hmr` command is executed
2 parents 74b406d + e349d17 commit f50c20e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/services/livesync/livesync-service.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
596596

597597
const startSyncFilesTimeout = (platform?: string) => {
598598
timeoutTimer = setTimeout(async () => {
599+
if (platform && liveSyncData.bundle) {
600+
filesToSync = filesToSyncMap[platform];
601+
}
602+
599603
if (filesToSync.length || filesToRemove.length) {
600604
const currentFilesToSync = _.cloneDeep(filesToSync);
601605
filesToSync.splice(0, filesToSync.length);
@@ -732,9 +736,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
732736
filesToRemove,
733737
startSyncFilesTimeout: async (platform: string) => {
734738
if (platform) {
735-
filesToSync = filesToSyncMap[platform];
736-
await startSyncFilesTimeout();
737-
filesToSyncMap[platform] = [];
739+
await startSyncFilesTimeout(platform);
738740
} else {
739741
// This code is added for backwards compatibility with old versions of nativescript-dev-webpack plugin.
740742
await startSyncFilesTimeout();

0 commit comments

Comments
 (0)