Skip to content

Commit d3a2eb9

Browse files
authored
feat: disabled close on swipe (#131)
1 parent 30f7e57 commit d3a2eb9

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

apps/storefront-telegram/app/components/CitySelector.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ watch(selectedCities, () => {
4949
}
5050
5151
cityStore.selected = cityStore.cities.find((c) => c.id === selectedCities.value[0])
52+
selectedCities.value = []
5253
isCitySelectOpened.value = false
5354
})
5455
</script>

apps/storefront-telegram/app/components/UserPointsCard.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
<UProgress
6565
v-model="progress"
6666
color="primary"
67+
:ui="{
68+
base: 'bg-primary/10',
69+
}"
6770
/>
6871
</div>
6972
</div>

apps/storefront-telegram/app/pages/user.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,25 @@
2525
label="Мои адреса"
2626
icon="i-lucide-map-pin-house"
2727
/>
28+
<UButton
29+
color="neutral"
30+
variant="ghost"
31+
label="Мои данные"
32+
icon="i-lucide-user"
33+
/>
34+
<UButton
35+
color="neutral"
36+
variant="ghost"
37+
:label="cityStore.selected ? cityStore.selected.name : 'Выбрать город'"
38+
icon="i-lucide-locate-fixed"
39+
@click="cityStore.selected = undefined"
40+
/>
2841
</UButtonGroup>
2942
</div>
3043
</PageContainer>
3144
</template>
3245

3346
<script setup lang="ts">
3447
const clientStore = useClientStore()
48+
const cityStore = useCityStore()
3549
</script>

apps/storefront-telegram/app/utils/init.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
bindThemeParamsCssVars,
44
bindViewportCssVars,
55
closingBehavior,
6+
disableVerticalSwipes,
67
emitEvent,
78
exitFullscreen,
89
init as initSDK,
@@ -85,6 +86,11 @@ export async function init(options: {
8586
closingBehavior.enableConfirmation()
8687
}
8788

89+
// Disable vertical swipes to prevent app close
90+
if (disableVerticalSwipes.isAvailable()) {
91+
disableVerticalSwipes()
92+
}
93+
8894
// Orientation lock
8995
postEvent('web_app_toggle_orientation_lock', {
9096
locked: true,

0 commit comments

Comments
 (0)