aboutsummaryrefslogtreecommitdiff
path: root/src/components/mao-forums.js
diff options
context:
space:
mode:
authorMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-19 03:02:16 -0400
committerMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-19 03:02:16 -0400
commit98b0aa1092d8b46b621a7d9d2772aa972d6957b6 (patch)
tree3d37eb06889e0a7bf8ad92fe4bf091e6d24bc8a6 /src/components/mao-forums.js
parent6603b409b2a712a48c3611782de560f442f8b241 (diff)
Made the website more interactive by adding alerts on successful and failed attempts when connecting to database. Also, dealt a bit with offline functionality.
Diffstat (limited to 'src/components/mao-forums.js')
-rw-r--r--src/components/mao-forums.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/components/mao-forums.js b/src/components/mao-forums.js
index 745c620..d4bee3c 100644
--- a/src/components/mao-forums.js
+++ b/src/components/mao-forums.js
@@ -110,7 +110,8 @@ class MaoForums extends connect(store)(PageViewElement) {
<h2 class="underline">Recent Posts</h2>
- <div class="post-grid" id="posts-grid"></div>
+ <div hidden="${!props.onceOnline}" class="post-grid" id="posts-grid"></div>
+ <div hidden="${props.onceOnline}"><h3>Please connect to internet so we can fetch forums.</h3></div>
</section>
`;
@@ -119,14 +120,25 @@ class MaoForums extends connect(store)(PageViewElement) {
static get properties() { return {
// This is the data from the store.
signedIn: Boolean,
- forumPosts: Array
+ forumPosts: Array,
+
+ onceOnline: Boolean
}}
+ constructor() {
+ super();
+
+ this.onceOnline = false;
+ }
+
_stateChanged(state) {
this.signedIn = state.firebaseAuth .signedIn;
this.forumPosts = state.firebaseFirestore .forumPosts;
-
this.updateSection();
+
+ if(!state.app.offline) {
+ this.onceOnline = true;
+ }
}
submitForum() {