user catalog navigation upgrade
This commit is contained in:
parent
21465022b3
commit
a575f75faf
@ -240,8 +240,13 @@ export default class UserProductHandler {
|
||||
}
|
||||
);
|
||||
|
||||
// Удаляем состояние пользователя
|
||||
userStates.delete(chatId);
|
||||
// Сохраняем состояние пользователя
|
||||
userStates.set(chatId, {
|
||||
...state,
|
||||
action: 'viewing_category',
|
||||
categoryId,
|
||||
location: state?.location // Сохраняем информацию о локации
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error in handleCategorySelection:', error);
|
||||
await bot.sendMessage(chatId, 'Error loading products. Please try again.');
|
||||
@ -337,14 +342,14 @@ export default class UserProductHandler {
|
||||
}
|
||||
|
||||
const message = `
|
||||
📦 ${product.name}
|
||||
|
||||
💰 Price: $${product.price}
|
||||
📝 Description: ${product.description}
|
||||
📦 Available: ${product.quantity_in_stock} pcs
|
||||
|
||||
Category: ${product.category_name}
|
||||
`;
|
||||
📦 ${product.name}
|
||||
|
||||
💰 Price: $${product.price}
|
||||
📝 Description: ${product.description}
|
||||
📦 Available: ${product.quantity_in_stock} pcs
|
||||
|
||||
Category: ${product.category_name}
|
||||
`;
|
||||
|
||||
// Отправляем фото, если оно существует
|
||||
let photoMessage;
|
||||
@ -388,7 +393,8 @@ export default class UserProductHandler {
|
||||
productId,
|
||||
quantity: 1,
|
||||
photoMessageId: photoMessage ? photoMessage.message_id : null,
|
||||
productMessageId: productMessage.message_id
|
||||
productMessageId: productMessage.message_id,
|
||||
location: state?.location // Сохраняем информацию о локации
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error in handleProductSelection:', error);
|
||||
|
Loading…
Reference in New Issue
Block a user