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:
parent
f185882de9
commit
46ec8c66ac
|
@ -112,6 +112,7 @@ func (m *FullMessage) Unwrap(grid *gtk.Grid) *message.GenericContainer {
|
||||||
// Remove GenericContainer's widgets from the containers.
|
// Remove GenericContainer's widgets from the containers.
|
||||||
m.HeaderBox.Remove(m.Username)
|
m.HeaderBox.Remove(m.Username)
|
||||||
m.HeaderBox.Remove(m.Timestamp)
|
m.HeaderBox.Remove(m.Timestamp)
|
||||||
|
m.MainBox.Remove(m.HeaderBox)
|
||||||
m.MainBox.Remove(m.Content)
|
m.MainBox.Remove(m.Content)
|
||||||
|
|
||||||
// Hide the avatar.
|
// Hide the avatar.
|
||||||
|
|
|
@ -112,16 +112,16 @@ func (c *GridStore) SwapMessage(msg GridMessage) bool {
|
||||||
// downwards.
|
// downwards.
|
||||||
c.Grid.InsertRow(ix)
|
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.
|
// Let the new message be attached on top of the to-be-replaced message.
|
||||||
c.attachGrid(ix, m.Attach())
|
c.attachGrid(ix, m.Attach())
|
||||||
|
|
||||||
// Set the message into the map.
|
// Set the message into the map.
|
||||||
c.messages[m.ID()] = m
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue