Blazored / Gitter

A Blazor Gitter Client
MIT License
37 stars 14 forks source link

Features - mark as read, timeout, autoscroll #21

Closed SQL-MisterMagoo closed 5 years ago

SQL-MisterMagoo commented 5 years ago

This is a merge of several updates from me as rebasing / merging each one was going to be a pain after all the css changes.

There is a slight modification to the login process on top of what Chris already changed.

MainLayout initialises AppState and that retrieves the apikey. MainLayout listens for GotApiKey and attempts a login (actually this is just fetching the user object)

ChatRoomList listens for GotChatUser and fetches the rooms - then starts a timed refresh of the rooms.

Room listens for GotChatRooms and only loads the requested room when the chat room list is loaded

Index is purely for displaying the User, or requesting their API token and storing it in the AppState - it does not handle any logging in or fetching of rooms.

New features are:

  1. Timeout - if the user is inactive for (currently 60 minutes) a period - stop updating the Room messages and display Paused...to save data when we go mobile. Not entirely new - but re-added.
  2. Mark messages as read - mouse out of a message will mark it as read after 1 second. Fixes #6
  3. If the message list is scrolled to the very bottom, new messages will automatically scroll into view, otherwise they will not. Fixes #19
  4. The room list updates every 10 seconds so the Unread messsage counts are dynamic. Fixes #20

I will add specific message inline to the diff if anything needs clarifying.

SQL-MisterMagoo commented 5 years ago

I fixed those errors in the console - stupid idiot mistake Fixed another when switching rooms it wasn't updating - both minor changes and tested.