Skip to content

Commit 65bc52f

Browse files
committed
only fix missing attributes
1 parent c2a75c7 commit 65bc52f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,12 @@ const codeActions = (params: CodeActionParams): CodeActionResult => {
317317
// TODO: drive this with diagnostic data
318318
const els = dom.getElementsByTagName("l-map")
319319
els.forEach(el => {
320-
el.setAttribute("zoom", "0")
321-
el.setAttribute("center", "[0, 0]")
320+
if (!el.hasAttribute("zoom")) {
321+
el.setAttribute("zoom", "0")
322+
}
323+
if (!el.hasAttribute("center")) {
324+
el.setAttribute("center", "[0, 0]")
325+
}
322326
})
323327

324328
// params.context.diagnostics.forEach(diagnostic => {

0 commit comments

Comments
 (0)