Update timeline stories

This commit is contained in:
Daniel Supernault 2020-05-29 23:53:50 -06:00
parent 8082dad3ec
commit eff35b00c7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div v-if="stories.length != 0"> <div v-if="show" class="card card-body p-0 border mt-4 mb-3 shadow-none">
<div id="storyContainer" :class="[list == true ? 'mt-1 mr-3 mb-0 ml-1':'mx-3 mt-3 mb-0 pb-0']"></div> <div id="storyContainer" :class="[list == true ? 'mt-1 mr-3 mb-0 ml-1':'mx-3 mt-3 mb-0 pb-0']"></div>
</div> </div>
</div> </div>
@ -21,6 +21,7 @@
props: ['list'], props: ['list'],
data() { data() {
return { return {
show: false,
stories: {}, stories: {},
} }
}, },
@ -34,6 +35,10 @@
axios.get('/api/stories/v0/recent') axios.get('/api/stories/v0/recent')
.then(res => { .then(res => {
let data = res.data; let data = res.data;
if(!res.data.length) {
this.show = false;
return;
}
let stories = new Zuck('storyContainer', { let stories = new Zuck('storyContainer', {
list: this.list == true ? true : false, list: this.list == true ? true : false,
stories: data, stories: data,
@ -70,6 +75,7 @@
}); });
}); });
}); });
this.show = true;
} }
} }
} }

View file

@ -7,7 +7,7 @@
</p> </p>
</div> </div>
<div :class="[modes.distractionFree ? 'col-md-8 col-lg-8 offset-md-2 px-0 mb-sm-3 timeline order-2 order-md-1':'col-md-8 col-lg-8 px-0 mb-sm-3 timeline order-2 order-md-1']"> <div :class="[modes.distractionFree ? 'col-md-8 col-lg-8 offset-md-2 px-0 mb-sm-3 timeline order-2 order-md-1':'col-md-8 col-lg-8 px-0 mb-sm-3 timeline order-2 order-md-1']">
<div v-if="config.features.stories" class="card card-body p-0 border mt-4 mb-3 shadow-none"> <div style="margin-top:32px;">
<story-component v-if="config.features.stories"></story-component> <story-component v-if="config.features.stories"></story-component>
</div> </div>
<div> <div>