File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ const flow = useFlowStore()
6666
6767// Guard
6868await user .update ()
69+ await user .updateOnline ()
6970if (! user .id ) {
7071 await navigateTo (' /no-auth' )
7172}
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 (' /' )
You can’t perform that action at this time.
0 commit comments