an experimental irc client

ui: reset unread indicator location on focus_in

rockorager.dev fc270054 a13927b8

verified
+13 -1
+13 -1
src/app.zig
··· 247 247 } 248 248 }, 249 249 .focus_out => self.has_focus = false, 250 - .focus_in => self.has_focus = true, 250 + 251 + .focus_in => { 252 + if (self.selectedBuffer()) |buffer| { 253 + // If we have a selected channel, we reset the last_read_indicator state when 254 + // losing focus. This means that any messages received 255 + switch (buffer) { 256 + .client => {}, 257 + .channel => |channel| channel.last_read_indicator = channel.last_read, 258 + } 259 + } 260 + 261 + self.has_focus = true; 262 + }, 251 263 252 264 else => {}, 253 265 }