Skip to content

Commit a3b37da

Browse files
authored
44.2.2
v4.2.2
2 parents c173362 + d2a4036 commit a3b37da

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solid-panes",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"description": "Solid-compatible Panes: applets and views for the mashlib and databrowser",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/outline/manager.js

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,8 +2100,24 @@ export default function (context) {
21002100
!UI.widgets.isAudio(subject) &&
21012101
!UI.widgets.isVideo(subject)
21022102
) {
2103+
const docUri = (subject.doc() && subject.doc().uri) ? subject.doc().uri : '' + subject.doc()
2104+
const appendOutlineError = function (detail, errObj) {
2105+
if (p.querySelector && docUri) {
2106+
const existing = p.querySelector('[data-outline-error-for="' + docUri + '"]')
2107+
if (existing) return
2108+
}
2109+
const message = UI.widgets.errorMessageBlock(
2110+
dom,
2111+
detail,
2112+
'#fee',
2113+
errObj instanceof Error ? errObj : undefined
2114+
)
2115+
if (docUri) message.setAttribute('data-outline-error-for', docUri)
2116+
p.appendChild(message)
2117+
}
21032118
// Wait till at least the main URI is loaded before expanding:
2104-
sf.nowOrWhenFetched(subject.doc(), undefined, function (ok, body) {
2119+
let errorReported = false
2120+
const fetchPromise = sf.nowOrWhenFetched(subject.doc(), undefined, function (ok, body) {
21052121
if (ok) {
21062122
sf.lookUpThing(subject)
21072123
render() // inital open, or else full if re-open
@@ -2111,14 +2127,17 @@ export default function (context) {
21112127
setUrlBarAndTitle(subject)
21122128
}
21132129
} else {
2114-
const message = dom.createElement('pre')
2115-
message.textContent = body
2116-
message.setAttribute('style', 'background-color: #fee;')
2117-
message.textContent =
2118-
'Outline.expand: Unable to fetch ' + subject.doc() + ': ' + body
2119-
p.appendChild(message)
2130+
errorReported = true
2131+
appendOutlineError(body, undefined)
21202132
}
21212133
})
2134+
if (fetchPromise && typeof fetchPromise.catch === 'function') {
2135+
fetchPromise.catch(function (err) {
2136+
if (errorReported) return
2137+
errorReported = true
2138+
appendOutlineError(err, err)
2139+
})
2140+
}
21222141
} else {
21232142
render()
21242143
}

0 commit comments

Comments
 (0)