Skip to content

Commit 3ce8a04

Browse files
authored
Hot Reload: Do not add empty div when diagnostics are empty (#51836)
1 parent 70e4be3 commit 3ce8a04

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BuiltInTools/Web.Middleware/WebSocketScriptInjection.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ setTimeout(async function () {
208208
console.debug('Reporting Hot Reload diagnostics.');
209209

210210
document.querySelectorAll('#dotnet-compile-error').forEach(el => el.remove());
211+
212+
if (diagnostics.length == 0) {
213+
return;
214+
}
215+
211216
const el = document.body.appendChild(document.createElement('div'));
212217
el.id = 'dotnet-compile-error';
213218
el.setAttribute('style', 'z-index:1000000; position:fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.5); color:black; overflow: scroll;');

0 commit comments

Comments
 (0)