user catalog navigation upgrade
This commit is contained in:
@@ -240,8 +240,13 @@ export default class UserProductHandler {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Удаляем состояние пользователя
|
// Сохраняем состояние пользователя
|
||||||
userStates.delete(chatId);
|
userStates.set(chatId, {
|
||||||
|
...state,
|
||||||
|
action: 'viewing_category',
|
||||||
|
categoryId,
|
||||||
|
location: state?.location // Сохраняем информацию о локации
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error in handleCategorySelection:', error);
|
console.error('Error in handleCategorySelection:', error);
|
||||||
await bot.sendMessage(chatId, 'Error loading products. Please try again.');
|
await bot.sendMessage(chatId, 'Error loading products. Please try again.');
|
||||||
@@ -388,7 +393,8 @@ export default class UserProductHandler {
|
|||||||
productId,
|
productId,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
photoMessageId: photoMessage ? photoMessage.message_id : null,
|
photoMessageId: photoMessage ? photoMessage.message_id : null,
|
||||||
productMessageId: productMessage.message_id
|
productMessageId: productMessage.message_id,
|
||||||
|
location: state?.location // Сохраняем информацию о локации
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error in handleProductSelection:', error);
|
console.error('Error in handleProductSelection:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user