Skip to content

Commit c6f1a0a

Browse files
author
Alain Bourgeois
committed
update dev to UVDSL
1 parent 8c86b97 commit c6f1a0a

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

dev/index.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
11
import * as logic from 'solid-logic'
2-
import pane from '../src/SourcePane'
2+
import pane from '../src/sourcePane'
33
import './dev-global.css'
44
import * as $rdf from 'rdflib'
55
import * as UI from 'solid-ui'
66

7+
console.log('dev/index.js loaded, pane is:', pane)
8+
79
const loginBanner = document.getElementById('loginBanner')
810
const webId = document.getElementById('webId')
911

10-
loginBanner.appendChild(UI.login.loginStatusBox(document, null, {}))
12+
if (loginBanner) {
13+
loginBanner.appendChild(UI.login.loginStatusBox(document, null, {}))
14+
}
1115

1216
async function finishLogin () {
13-
await logic.authSession.handleIncomingRedirect()
17+
const me = await logic.authn.checkUser()
1418
const session = logic.authSession
15-
if (session.info.isLoggedIn) {
16-
// Update the page with the status.
17-
webId.innerHTML = 'Logged in as: ' + logic.authn.currentUser().uri
19+
const sessionWebId = session?.webId ?? session?.info?.webId ?? null
20+
const meWebId = me?.uri ?? me?.value ?? null
21+
const webIdUri = meWebId ?? sessionWebId
22+
const isLoggedIn = Boolean(
23+
me ||
24+
session?.isActive ||
25+
session?.info?.isLoggedIn ||
26+
sessionWebId
27+
)
28+
29+
if (isLoggedIn && webIdUri) {
30+
if (webId) {
31+
webId.innerHTML = 'Logged in as: ' + webIdUri
32+
}
1833
} else {
19-
webId.innerHTML = ''
34+
if (webId) {
35+
webId.innerHTML = ''
36+
}
2037
}
2138
}
2239

0 commit comments

Comments
 (0)