Smarter loading.
This changes to always on explore (though this may change yet again). This is so we always get new events and we simply filter out who we want to see. This also replaces the recent history. I also changed contacts to check if we have contacts from storage and if not to fetch them. This solves login loading issues. There are still issues (IMO) with profile loading and thread loading that need investigation. Profile loading just seems slow and threads seems to not have posts. I think this may be because the relay is not sending them to me because it's busy with the explore subscription. The other relays seem fine, but Damus relay seems slow or unresponsive as I will send a REQ and it will go completely unanswered, yet return explore events.
This commit is contained in:
parent
9fa6974914
commit
1847b64855
3 changed files with 31 additions and 35 deletions
|
@ -19,27 +19,15 @@ function view_timeline_apply_mode(model, mode, opts={}) {
|
|||
el.dataset.threadId == thread_id))
|
||||
return;
|
||||
|
||||
// Set the last time we were actively viewing explore to correctly fetch
|
||||
// the history in the future
|
||||
if (el.dataset.mode == VM_EXPLORE && mode != VM_EXPLORE) {
|
||||
model.seen_explore = now;
|
||||
}
|
||||
|
||||
if (mode == VM_EXPLORE) {
|
||||
// If the time between the last explore and now is less than a minute
|
||||
// simply only fetch a few
|
||||
subscribe_explore((now - model.seen_explore) / 1000 < 60 ? 100 : 500);
|
||||
} else {
|
||||
unsubscribe_explore();
|
||||
}
|
||||
// Fetch history for certain views
|
||||
if (mode == VM_THREAD || mode == VM_USER) {
|
||||
fetch_thread_history(thread_id, model.pool);
|
||||
view_show_spinner(true);
|
||||
fetch_thread_history(thread_id, model.pool);
|
||||
}
|
||||
|
||||
// Request the background info for this user
|
||||
if (pubkey)
|
||||
if (pubkey) {
|
||||
view_show_spinner(true);
|
||||
fetch_profile(pubkey, model.pool);
|
||||
}
|
||||
|
||||
el.dataset.mode = mode;
|
||||
switch(mode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue