Commit 8c781ef5dd08dd3ad321614199ef07f2e066c3ec
don't destroy default views after timeout
Matt McKegg committed on 2/17/2017, 1:14:52 PMParent: e53edca084bc70ef3f036ee0684009ae71da41df
Files changed
main-window.js | changed |
main-window.js | ||
---|---|---|
@@ -57,14 +57,17 @@ | ||
57 | 57 … | // '/notifications': renderPage('/notifications') |
58 | 58 … | }) |
59 | 59 … | |
60 | 60 … | var lastViewed = {} |
61 … | + var defaultViews = views.keys() | |
61 | 62 … | |
62 | 63 … | // delete cached view after 30 mins of last seeing |
63 | 64 … | setInterval(() => { |
64 | 65 … | views.keys().forEach((view) => { |
65 | - if (lastViewed[view] !== true && Date.now() - lastViewed[view] > (30 * 60e3) && view !== currentView()) { | |
66 | - views.delete(view) | |
66 … | + if (!defaultViews.includes(view)) { | |
67 … | + if (lastViewed[view] !== true && Date.now() - lastViewed[view] > (5 * 60e3) && view !== currentView()) { | |
68 … | + views.delete(view) | |
69 … | + } | |
67 | 70 … | } |
68 | 71 … | }) |
69 | 72 … | }, 60e3) |
70 | 73 … |
Built with git-ssb-web