Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-06-26 13:31:15 +06:00 committed by GitHub
parent 35315bbf7e
commit 66275fd344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -53,10 +53,10 @@ export function parseLocation (location: Location | URL): PlatformLocation {
}
}
function parseQuery (query: string): Record<string, string | null> {
function parseQuery (query: string): Record<string, string | null> | undefined {
query = query.trim()
if (query.length === 0 || !query.startsWith('?')) {
return {}
return
}
query = decodeURIComponent(query).substring(1)
const vars = query.split('&')

View File

@ -82,6 +82,7 @@
let currentAppAlias: string | undefined
let currentSpace: Ref<Space> | undefined
let currentSpecial: string | undefined
let currentQuery: Record<string, string | null> | undefined
let specialComponent: SpecialNavModel | undefined
let asideId: string | undefined
let currentFragment: string | undefined = ''
@ -264,6 +265,7 @@
break
}
}
loc.query = resolved.loc.query ?? loc.query ?? currentQuery ?? resolved.defaultLocation.query
loc.fragment = resolved.loc.fragment ?? loc.fragment ?? resolved.defaultLocation.fragment
return loc
}
@ -363,6 +365,7 @@
if (app !== undefined) {
localStorage.setItem(`platform_last_loc_${app}`, originalLoc)
}
currentQuery = loc.query
if (fragment !== currentFragment) {
currentFragment = fragment
if (fragment !== undefined && fragment.trim().length > 0) {
@ -533,8 +536,6 @@
: 'account'
let popupSpacePosition: PopupPosAlignment
$: popupSpacePosition = appsMini ? 'logo-mini' : appsDirection === 'horizontal' ? 'logo-portrait' : 'logo'
let notifyPosition: PopupPosAlignment
$: notifyPosition = appsDirection === 'horizontal' ? 'notify-mobile' : 'notify'
onMount(() => subscribeMobile(setTheme))