Skip to content

Commit cdd896a

Browse files
committed
refactor(popup): drop the unused renderError parameter
The `renderError` function took a parameter `urlInfo` it never uses.
1 parent e37d34e commit cdd896a

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎popup/popup.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function render(prs, urlInfo) {
3131
li.setAttribute("class", "pr-list__empty")
3232
li.textContent = browser.i18n.getMessage("popupEmptyList")
3333
ul.appendChild(li)
34-
return
34+
return
3535
}
3636

3737
const fragment = document.createDocumentFragment()
@@ -47,7 +47,7 @@ export function render(prs, urlInfo) {
4747
ul.appendChild(fragment)
4848
}
4949

50-
export function renderError(urlInfo) {
50+
export function renderError() {
5151
// create a div element
5252
const div = document.createElement("div")
5353
div.setAttribute("id", "error")
@@ -56,7 +56,6 @@ export function renderError(urlInfo) {
5656
// replace the ul element with the div element
5757
const ul = document.getElementById("prs")
5858
document.body.replaceChild(div, ul)
59-
6059
}
6160

6261
//
@@ -80,7 +79,7 @@ async function init() {
8079
render(result.prs, urlInfo)
8180
} else {
8281
// error in bg script
83-
renderError(urlInfo)
82+
renderError()
8483
}
8584
}
8685
// register the popup logic against the browser; skipped when this module is

‎tests/popup.test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ test("render shows the empty state when no PR touches the file", () => {
128128
test("renderError replaces the list with an error element", () => {
129129
reset()
130130

131-
renderError(urlInfo)
131+
renderError()
132132

133133
const { newNode, oldNode } = documentMock.body.replaced
134134
assert.equal(oldNode, prsNode)

0 commit comments

Comments
 (0)