1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-gtk.git synced 2025-01-03 09:36:50 +00:00

fixed parent == nil assertion fail

This commit is contained in:
diamondburned 2020-10-24 18:13:33 -07:00
parent f185882de9
commit 46ec8c66ac
2 changed files with 5 additions and 4 deletions

View file

@ -112,6 +112,7 @@ func (m *FullMessage) Unwrap(grid *gtk.Grid) *message.GenericContainer {
// Remove GenericContainer's widgets from the containers.
m.HeaderBox.Remove(m.Username)
m.HeaderBox.Remove(m.Timestamp)
m.MainBox.Remove(m.HeaderBox)
m.MainBox.Remove(m.Content)
// Hide the avatar.

View file

@ -112,16 +112,16 @@ func (c *GridStore) SwapMessage(msg GridMessage) bool {
// downwards.
c.Grid.InsertRow(ix)
// Delete the to-be-replaced message, which we have shifted downwards
// earlier, so we add 1.
c.Grid.RemoveRow(ix + 1)
// Let the new message be attached on top of the to-be-replaced message.
c.attachGrid(ix, m.Attach())
// Set the message into the map.
c.messages[m.ID()] = m
// Delete the to-be-replaced message, which we have shifted downwards
// earlier, so we add 1.
c.Grid.RemoveRow(ix + 1)
return true
}