feat: add support for the Web Share Target API (#1100)

Co-authored-by: userquin <userquin@gmail.com>
This commit is contained in:
Horváth Bálint 2023-01-14 21:58:52 +01:00 committed by GitHub
parent a6a825e553
commit bede92404b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 221 additions and 7 deletions

View file

@ -5,8 +5,12 @@ export default defineNuxtRouteMiddleware((to) => {
return
onMastoInit(() => {
if (!currentUser.value)
return navigateTo(`/${currentServer.value}/public/local`)
if (!currentUser.value) {
if (to.path === '/home' && to.query['share-target'] !== undefined)
return navigateTo('/share-target')
else
return navigateTo(`/${currentServer.value}/public/local`)
}
if (to.path === '/')
return navigateTo('/home')
})