Spaces:
Paused
Paused
Deploy Bot commited on
Commit ·
2cd8edd
1
Parent(s): c04d99a
Fix: Explicit delivery method check to prevent Pickup fallback to Yandex
Browse files198 unmodified lines19920020120220320420520620720815 unmodified lines224225226227228229230231232233234235236237238239240241242243244245246247198 unmodified linesreturn ctx.wizard.selectStep(0) && ctx.wizard.steps[0](ctx);}const text = ctx.message.text;ctx.wizard.state.deliveryMethod = text;if (text === i18n.delivery_pickup) {ctx.wizard.state.location = null;const Settings = require('../../models/Settings');15 unmodified linesreturn ctx.wizard.selectStep(6);}if (text === i18n.delivery_bts) {ctx.reply("📝 " + i18n.settings_addr, navKeyboard(ctx, i18n));return ctx.wizard.next(); // Step 3}// Yandexconst user = ctx.wizard.state.user;const btns = [];if (user && user.addresses && user.addresses.length > 0) {user.addresses.forEach((addr, i) => {btns.push([i18n.checkout_location_saved.replace('{name}', addr.name || 'Saved Address')]);});}btns.push([Markup.button.locationRequest(i18n.location_button)]);btns.push([i18n.btn_back_nav, i18n.btn_cancel]);ctx.reply(i18n.address_prompt, Markup.keyboard(btns).resize().oneTime());return ctx.wizard.selectStep(5); // Step 5},// Step 3: BTS Address(ctx) => {198 unmodified lines19920020120220320420520620720815 unmodified lines224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257198 unmodified linesreturn ctx.wizard.selectStep(0) && ctx.wizard.steps[0](ctx);}const text = ctx.message.text.trim(); // Trim inputctx.wizard.state.deliveryMethod = text;if (text === i18n.delivery_pickup.trim()) {ctx.wizard.state.location = null;const Settings = require('../../models/Settings');15 unmodified linesreturn ctx.wizard.selectStep(6);}if (text === i18n.delivery_bts.trim()) {ctx.reply("📝 " + i18n.settings_addr, navKeyboard(ctx, i18n));return ctx.wizard.next(); // Step 3}// Yandex Explicit Checkif (text === i18n.delivery_yandex.trim()) {const user = ctx.wizard.state.user;const btns = [];if (user && user.addresses && user.addresses.length > 0) {user.addresses.forEach((addr, i) => {btns.push([i18n.checkout_location_saved.replace('{name}', addr.name || 'Saved Address')]);});}btns.push([Markup.button.locationRequest(i18n.location_button)]);btns.push([i18n.btn_back_nav, i18n.btn_cancel]);ctx.reply(i18n.address_prompt, Markup.keyboard(btns).resize().oneTime());return ctx.wizard.selectStep(5); // Step 5}// Unknown Inputctx.reply(i18n.delivery_select, Markup.keyboard([[i18n.delivery_yandex, i18n.delivery_bts],[i18n.delivery_pickup],[i18n.btn_back_nav, i18n.btn_cancel]]).resize().oneTime());return; // Stay in step},// Step 3: BTS Address(ctx) => {
src/scenes/user/checkout.js+24-14