Support editing of not-fully-created topic.
This commit is contained in:
parent
3722e55b67
commit
5d43073efa
|
@ -157,8 +157,9 @@ void EditForumTopicBox(
|
|||
};
|
||||
|
||||
const auto save = [=] {
|
||||
const auto topic = forum->peer->forum()
|
||||
? forum->peer->forum()->topicFor(rootId)
|
||||
const auto parent = forum->peer->forum();
|
||||
const auto topic = parent
|
||||
? parent->topicFor(rootId)
|
||||
: nullptr;
|
||||
if (!topic) {
|
||||
box->closeBox();
|
||||
|
@ -169,7 +170,9 @@ void EditForumTopicBox(
|
|||
if (title->getLastText().trimmed().isEmpty()) {
|
||||
title->showError();
|
||||
return;
|
||||
}
|
||||
} else if (parent->creating(rootId)) {
|
||||
topic->applyTitle(title->getLastText().trimmed());
|
||||
} else {
|
||||
const auto done = [=] {
|
||||
state->titleRequestId = 0;
|
||||
if (!state->iconRequestId) {
|
||||
|
@ -191,7 +194,11 @@ void EditForumTopicBox(
|
|||
}
|
||||
}).send();
|
||||
}
|
||||
if (state->iconRequestId <= 0) {
|
||||
}
|
||||
if (parent->creating(rootId)) {
|
||||
topic->applyIconId(state->iconId);
|
||||
box->closeBox();
|
||||
} else if (state->iconRequestId <= 0) {
|
||||
const auto done = [=] {
|
||||
state->iconRequestId = 0;
|
||||
if (!state->titleRequestId) {
|
||||
|
|
Loading…
Reference in New Issue