Skip to content

Commit 9370b86

Browse files
committed
copilot suggestions
1 parent 5319223 commit 9370b86

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/StatusSection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import './StatusSection.css'
44
export function getStatusSection(){
55
function showError(message: string) {
66
const statusSection = document.querySelector('.sourcePaneStatus') as HTMLElement | null
7-
const statusMessageArea = document.getElementById('statusMessageArea')
7+
const statusMessageArea = statusSection?.querySelector('#statusMessageArea') as HTMLElement | null
88
if (statusSection) {
99
statusSection.dataset.visible = 'true'
1010
}
@@ -19,7 +19,7 @@ export function getStatusSection(){
1919

2020
function clearError() {
2121
const statusSection = document.querySelector('.sourcePaneStatus') as HTMLElement | null
22-
const statusMessageArea = document.getElementById('statusMessageArea')
22+
const statusMessageArea = statusSection?.querySelector('#statusMessageArea') as HTMLElement | null
2323
if (statusSection) {
2424
statusSection.dataset.visible = 'false'
2525
}

src/helpers.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ export function checkSyntax (store: LiveStore, subject: NamedNode, data: string,
8686
}
8787
try {
8888
clearError()
89-
if (contentType === 'application/json') return JSON.parse(data)
90-
else {
89+
if (contentType === 'application/json') {
90+
JSON.parse(data)
91+
return true
92+
} else {
9193
try {
9294
store.removeDocument(subject)
9395
} catch (err: any) {
@@ -168,7 +170,7 @@ export function getResponseHeaders (store: LiveStore, subject: NamedNode, respon
168170
const reqs = store.each(
169171
null,
170172
store.sym('http://www.w3.org/2007/ont/link#requestedURI'),
171-
subject as any
173+
subject
172174
)
173175
reqs.forEach((req: any) => {
174176
const rrr = store.any(

0 commit comments

Comments
 (0)