Skip to content

Commit 30b6c6b

Browse files
authored
chore: user click updated (#157)
1 parent 8898b57 commit 30b6c6b

4 files changed

Lines changed: 28 additions & 7 deletions

File tree

apps/atrium-telegram/app/app.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const flow = useFlowStore()
6666
6767
// Guard
6868
await user.update()
69+
await user.updateOnline()
6970
if (!user.id) {
7071
await navigateTo('/no-auth')
7172
}

apps/atrium-telegram/app/components/StaffBlock.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,18 @@ async function handleClick(userId: string) {
8383
if (showPopup.isAvailable()) {
8484
const buttonId = await showPopup({
8585
title: `${user.name} ${user.surname}`,
86-
message: 'Выберите действие',
86+
message: user.caption,
8787
buttons: [
8888
{
8989
id: 'open',
9090
type: 'default',
9191
text: 'Открыть Telegram',
9292
},
93+
{
94+
id: 'call',
95+
type: 'default',
96+
text: 'Позвонить',
97+
},
9398
{
9499
type: 'close',
95100
},
@@ -99,6 +104,10 @@ async function handleClick(userId: string) {
99104
if (buttonId === 'open') {
100105
openTelegramLink(`https://t.me/+${user.phone}?profile`)
101106
}
107+
108+
if (buttonId === 'call') {
109+
window.open(`tel:+${user.phone}`)
110+
}
102111
}
103112
}
104113
</script>

apps/atrium-telegram/app/composables/useBackButton.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ function _useBackButton() {
1515
}
1616
})
1717

18-
function onBackButtonClick(): void {
18+
async function onBackButtonClick(): Promise<void> {
19+
// If have query "from=startapp" go to index
20+
if (router.currentRoute.value.query.from === 'startapp') {
21+
await navigateTo('/')
22+
return
23+
}
24+
1925
router.go(-1)
2026
}
2127
}

apps/atrium-telegram/app/pages/startapp.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ if (tgWebAppStartParam?.length && tgWebAppStartParam.includes(separator)) {
1818
await navigateTo('/')
1919
}
2020
21-
if (key === 'epic') {
22-
await navigateTo(`/epic/${value}`)
23-
}
21+
const query = { from: 'startapp' }
2422
25-
if (key === 'flow') {
26-
await navigateTo(`/flow/${value}`)
23+
switch (key) {
24+
case 'flow':
25+
await navigateTo({ path: `/flow/${value}`, query })
26+
break
27+
case 'epic':
28+
await navigateTo({ path: `/epic/${value}`, query })
29+
break
30+
default:
31+
await navigateTo('/')
2732
}
2833
} else {
2934
await navigateTo('/')

0 commit comments

Comments
 (0)