From 98b0aa1092d8b46b621a7d9d2772aa972d6957b6 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Sun, 19 Aug 2018 03:02:16 -0400 Subject: Made the website more interactive by adding alerts on successful and failed attempts when connecting to database. Also, dealt a bit with offline functionality. --- src/components/competition-element.js | 2 +- src/components/mao-forums.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src/components') diff --git a/src/components/competition-element.js b/src/components/competition-element.js index 67cc668..730b48e 100644 --- a/src/components/competition-element.js +++ b/src/components/competition-element.js @@ -84,7 +84,7 @@ class CompetitionElement extends LitElement { } registerComp() { - if(confirm('Are you sure you want to register for ' + this.name + '?')) { + if(confirm('Are you sure you want to register for ' + this.name.replace(/[0-9]/g, '') + '?')) { this.dispatchEvent(new CustomEvent('register-comp')); } } 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) {

Recent Posts

-
+ + `; @@ -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() { -- cgit v1.2.3-70-g09d2