нейминг кнопок
This commit is contained in:
@@ -15,10 +15,10 @@ import (
|
||||
const projectsPerPage = 6
|
||||
|
||||
type MyProjects struct {
|
||||
CurrentPage int
|
||||
WorkspaceID string
|
||||
BackState bot.State
|
||||
OpenPurchases bool
|
||||
CurrentPage int
|
||||
WorkspaceID string
|
||||
BackState bot.State
|
||||
OpenPlacements bool
|
||||
|
||||
// Поля для управления фоновой горутиной polling
|
||||
cancel context.CancelFunc
|
||||
@@ -106,8 +106,8 @@ func (s *MyProjects) renderProjects(b *bot.Bot, mode bot.RenderMode, jwt string)
|
||||
|
||||
Начните с добавления первого проекта`
|
||||
nonEmptyText := "Управление вашими Telegram-каналами.\n\nВыберите канал"
|
||||
if s.OpenPurchases {
|
||||
headerTitle = "Закупы"
|
||||
if s.OpenPlacements {
|
||||
headerTitle = "Размещения"
|
||||
nonEmptyText = "Выберите проект для просмотра закупов"
|
||||
}
|
||||
|
||||
@@ -224,12 +224,12 @@ func (s *MyProjects) HandleCallback(b *bot.Bot, u *echotron.Update) {
|
||||
return
|
||||
}
|
||||
|
||||
if s.OpenPurchases {
|
||||
b.SetState(&Purchases{
|
||||
if s.OpenPlacements {
|
||||
b.SetState(&Placements{
|
||||
WorkspaceID: s.WorkspaceID,
|
||||
ProjectID: project.ID,
|
||||
ProjectTitle: project.Title,
|
||||
BackState: &MyProjects{WorkspaceID: s.WorkspaceID, OpenPurchases: true},
|
||||
BackState: &MyProjects{WorkspaceID: s.WorkspaceID, OpenPlacements: true},
|
||||
}, bot.EditMessage)
|
||||
} else {
|
||||
b.SetState(&ProjectDetails{
|
||||
|
||||
Reference in New Issue
Block a user