Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-panes",
"version": "4.2.1",
"version": "4.2.2",
"description": "Solid-compatible Panes: applets and views for the mashlib and databrowser",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
33 changes: 26 additions & 7 deletions src/outline/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2100,8 +2100,24 @@ export default function (context) {
!UI.widgets.isAudio(subject) &&
!UI.widgets.isVideo(subject)
) {
const docUri = (subject.doc() && subject.doc().uri) ? subject.doc().uri : '' + subject.doc()
const appendOutlineError = function (detail, errObj) {
if (p.querySelector && docUri) {
const existing = p.querySelector('[data-outline-error-for="' + docUri + '"]')
if (existing) return
}
const message = UI.widgets.errorMessageBlock(
dom,
detail,
'#fee',
errObj instanceof Error ? errObj : undefined
)
if (docUri) message.setAttribute('data-outline-error-for', docUri)
p.appendChild(message)
}
// Wait till at least the main URI is loaded before expanding:
sf.nowOrWhenFetched(subject.doc(), undefined, function (ok, body) {
let errorReported = false
const fetchPromise = sf.nowOrWhenFetched(subject.doc(), undefined, function (ok, body) {
if (ok) {
sf.lookUpThing(subject)
render() // inital open, or else full if re-open
Expand All @@ -2111,14 +2127,17 @@ export default function (context) {
setUrlBarAndTitle(subject)
}
} else {
const message = dom.createElement('pre')
message.textContent = body
message.setAttribute('style', 'background-color: #fee;')
message.textContent =
'Outline.expand: Unable to fetch ' + subject.doc() + ': ' + body
p.appendChild(message)
errorReported = true
appendOutlineError(body, undefined)
}
})
if (fetchPromise && typeof fetchPromise.catch === 'function') {
fetchPromise.catch(function (err) {
if (errorReported) return
errorReported = true
appendOutlineError(err, err)
})
}
} else {
render()
}
Expand Down
Loading