irc: show current buffer after (re)init to avoid needing manual switch; preload history on open

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-09-20 02:19:42 +03:00
parent 499adacb06
commit 747b30ad55

View File

@@ -88,6 +88,13 @@ function IrcChatView:init(reinit)
end
self:updateTitle()
TextViewer.init(self, reinit)
-- Ensure current buffer content is shown immediately after (re)init
local tgt = self._current_target or "*"
self:preloadHistory(tgt)
if self.scroll_text_w and self.scroll_text_w.text_widget then
self.scroll_text_w.text_widget:setText(self._buffers[tgt] or "")
self.scroll_text_w:scrollToBottom()
end
-- Start connection after UI init so we can show logs
UIManager:nextTick(function() self:startConnection() end)
end