diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-06-18 01:02:38 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-06-18 01:07:56 +0200 |
commit | e21c078521c061fe019083ec5a5f62a99e6254d1 (patch) | |
tree | 9a46ac14556e6c5cb6ee922c740ee4cf2b2a996f /client | |
parent | 0ff1e63a5d82d1fb3a6f0a0d994ac2c30cdb1c9f (diff) | |
download | wekan-e21c078521c061fe019083ec5a5f62a99e6254d1.tar.gz wekan-e21c078521c061fe019083ec5a5f62a99e6254d1.tar.bz2 wekan-e21c078521c061fe019083ec5a5f62a99e6254d1.zip |
Fix activities view on mobile devices
Turns out that the sidebar is not available on mobile device therefore add
guards for this for now. This needs further investigation.
Diffstat (limited to 'client')
-rw-r--r-- | client/components/activities/activities.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index edfaab2a..83843d1d 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -7,8 +7,9 @@ BlazeComponent.extendComponent({ // XXX Should we use ReactiveNumber? this.page = new ReactiveVar(1); this.loadNextPageLocked = false; + // TODO is sidebar always available? E.g. on small screens/mobile devices const sidebar = Sidebar; - sidebar.callFirstWith(null, 'resetNextPeak'); + sidebar && sidebar.callFirstWith(null, 'resetNextPeak'); this.autorun(() => { let mode = this.data().mode; const capitalizedMode = Utils.capitalize(mode); @@ -29,6 +30,8 @@ BlazeComponent.extendComponent({ this.subscribe('activities', mode, searchId, limit, hideSystem, () => { this.loadNextPageLocked = false; + // TODO the guard can be removed as soon as the TODO above is resolved + if (!sidebar) return; // If the sibear peak hasn't increased, that mean that there are no more // activities, and we can stop calling new subscriptions. // XXX This is hacky! We need to know excatly and reactively how many |