增加一次性群邀请链接和二维码
This commit is contained in:
1 parent
dfeb5bfefa
commit
5ec9c81f90
18 files changed
+727
-14
No files matched your search
@@ -9,6 +9,7 @@ import ChatView from './views/ChatView.vue'
|
||||
import GroupView from './views/GroupView.vue'
|
||||
import Workspace from './views/Workspace.vue'
|
||||
import { useSession } from './session'
|
||||
import { incomingGroupInvite, parseGroupInvite } from './chat/group-invites'
|
||||
import './style.css'
|
||||
|
||||
const pinia = createPinia()
|
||||
@@ -29,6 +30,10 @@ const router = createRouter({
|
||||
|
||||
router.beforeEach((to) => {
|
||||
const signedIn = Boolean(useSession(pinia).identity)
|
||||
if (to.path === '/groups' && typeof to.query.invite === 'string') {
|
||||
incomingGroupInvite.value = parseGroupInvite(to.query.invite)
|
||||
return { path: signedIn ? '/groups' : '/login', replace: true }
|
||||
}
|
||||
if (!signedIn && to.path !== '/login') return '/login'
|
||||
if (signedIn && to.path === '/login') return '/devices'
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user