From 6ae3c1cfcf896839f799888e53fc751db952b0f1 Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 3 May 2019 07:52:22 -0400 Subject: autoload older notifications when scrolled to the bottom --- src/components/mobile_nav/mobile_nav.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/components/mobile_nav/mobile_nav.js') diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js index bc63d2ba..9b341a3b 100644 --- a/src/components/mobile_nav/mobile_nav.js +++ b/src/components/mobile_nav/mobile_nav.js @@ -63,6 +63,11 @@ const MobileNav = { }, markNotificationsAsSeen () { this.$refs.notifications.markAsSeen() + }, + onScroll ({ target: { scrollTop, clientHeight, scrollHeight } }) { + if (this.$store.state.config.autoLoad && scrollTop + clientHeight >= scrollHeight) { + this.$refs.notifications.fetchOlderNotifications() + } } }, watch: { -- cgit v1.2.3-70-g09d2