Remove parseQuery and use params
This commit is contained in:
parent
e0d895f22a
commit
7939793351
@ -36,17 +36,12 @@ const makeThumbnailURL = mxc => `${HOMESERVER_URL}/_matrix/media/r0/thumbnail/${
|
|||||||
// This is also used to fix scrolling to sections on Element iOS
|
// This is also used to fix scrolling to sections on Element iOS
|
||||||
const isMobileSafari = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/)
|
const isMobileSafari = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/)
|
||||||
|
|
||||||
export const parseQuery = str => Object.fromEntries(
|
|
||||||
str.split("&")
|
|
||||||
.map(part => part.split("="))
|
|
||||||
.map(([key, value = ""]) => [key, value]))
|
|
||||||
|
|
||||||
const supportedThemes = ["light", "dark", "black"]
|
const supportedThemes = ["light", "dark", "black"]
|
||||||
|
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.defaultTheme = parseQuery(location.search.substr(1)).theme
|
this.defaultTheme = params.get("theme")
|
||||||
this.state = {
|
this.state = {
|
||||||
packs: [],
|
packs: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user