Skip to content

Commit 3c2da34

Browse files
alan-agius4mgechev
authored andcommitted
fix(@angular-devkit/build-angular): only show cannot restore inputs/options when old length is > 0
1 parent 49841f8 commit 3c2da34

File tree

1 file changed

+3
-3
lines changed
  • packages/angular_devkit/build_angular/src/webpack/plugins/hmr

1 file changed

+3
-3
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/hmr/hmr-accept.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export default function (mod) {
193193

194194
dispatchEvents(newElement);
195195
}
196-
} else {
196+
} else if (oldInputs.length) {
197197
console.warn('[NG HMR] Cannot restore input/textarea values.');
198198
}
199199

@@ -207,8 +207,8 @@ export default function (mod) {
207207

208208
dispatchEvents(newElement);
209209
}
210-
} else {
210+
} else if (oldOptions.length) {
211211
console.warn('[NG HMR] Cannot restore selected options.');
212212
}
213213
}
214-
}
214+
}

0 commit comments

Comments
 (0)