Skip to content

Commit

Permalink
fix message limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
Luch00 committed Sep 24, 2018
1 parent 18a0798 commit a7083d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions LxBTSC/template/js/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ function ThumbnailAvatar(img) {
}

function CheckMessageLimit(tab) {
if (tab.childElementCount > Config.MAX_LINES) {
tab.firstElementChild.remove();
let over = tab.children().length - Config.MAX_LINES;
if(over > 0) {
tab.children().slice(0, over).remove();
}
}

Expand Down
7 changes: 5 additions & 2 deletions QtLxBTSC/ChatWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ ChatWidget::ChatWidget(QString path, TsWebObject* webObject, QWidget *parent)
connect(view, &QWebEngineView::customContextMenuRequested, this, &ChatWidget::onShowContextMenu);
connect(view, &QWebEngineView::loadFinished, this, [=]()
{
loadComplete = true;
ts3Functions.logMessage("Page load finished", LogLevel_INFO, "BetterChat", 0);
if (!loadComplete)
{
loadComplete = true;
ts3Functions.logMessage("Page load finished", LogLevel_INFO, "BetterChat", 0);
}
});

setupPage();
Expand Down

0 comments on commit a7083d9

Please sign in to comment.