Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds demo login #63

Merged
merged 6 commits into from
May 18, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adds consistency to demo login
  • Loading branch information
johnSamilin committed May 18, 2023
commit 1f7176e6816f2aed4cf711239eed55aab4b2d3b7
3 changes: 3 additions & 0 deletions src/App.mjs
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ document.body.addEventListener('click', (event) => {

window.addEventListener('load', async () => {
await AuthManager.start()
if (location.pathname === '/demo') {
AuthManager.requestDemoAccess()
}
if (await AuthManager.validate()) {
Router.start()
}
5 changes: 2 additions & 3 deletions src/core/FeatureDetector.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ts-check

import { Store } from "./Store.mjs"

let instance

const mobileMediaQuery = window.matchMedia('(max-width: 425px)')
@@ -50,7 +48,8 @@ class CFeatureDetector {
mobileMediaQuery.addEventListener('change', this.#updateIsMobile)
}

#updateIsMobile = (evt) => {
#updateIsMobile = async (evt) => {
const { Store } = await import('./Store.mjs')
this.#isMobile = evt.matches
Store.set('isMobile', this.#isMobile)
}