The "cache" is just a react context which is destroyed on reload. Abstract one layer down to the chrome API.
When populated, pull from here initially (Still try network request) So offline shows this possibly out of date data first, but makes the user not as angry >:(
Every time the context is updated write to this cache again.
Also make sure when writing to the disk that messages arrays are not > x amount. The user should be able to load a lot of messages into memory, but maybe only 200 per chat when reloading or offline use.
The "cache" is just a react context which is destroyed on reload. Abstract one layer down to the chrome API. When populated, pull from here initially (Still try network request) So offline shows this possibly out of date data first, but makes the user not as angry >:( Every time the context is updated write to this cache again.
Also make sure when writing to the disk that messages arrays are not > x amount. The user should be able to load a lot of messages into memory, but maybe only 200 per chat when reloading or offline use.