fix: only remove logging channels if we added them (#5828)
This commit is contained in:
@@ -41,7 +41,7 @@ Channel::Channel(const QString &name, Type type)
|
||||
Channel::~Channel()
|
||||
{
|
||||
auto *app = tryGetApp();
|
||||
if (app)
|
||||
if (app && this->anythingLogged_)
|
||||
{
|
||||
app->getChatLogger()->closeChannel(this->name_, this->platform_);
|
||||
}
|
||||
@@ -106,6 +106,7 @@ void Channel::addMessage(MessagePtr message, MessageContext context,
|
||||
getApp()->getChatLogger()->addMessage(this->name_, message,
|
||||
this->platform_,
|
||||
this->getCurrentStreamID());
|
||||
this->anythingLogged_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ private:
|
||||
const QString name_;
|
||||
LimitedQueue<MessagePtr> messages_;
|
||||
Type type_;
|
||||
bool anythingLogged_ = false;
|
||||
QTimer clearCompletionModelTimer_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user