FIX: simplifies upcoming events page and prevents double rendering

FIX: simplifies upcoming events page and prevents double rendering

diff --git a/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6 b/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6
index 52baa67..1282cbb 100644
--- a/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6
+++ b/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6
@@ -28,12 +28,6 @@ export default Component.extend({
     this._renderCalendar();
   },
 
-  didReceiveAttrs() {
-    this._super(...arguments);
-
-    this._renderCalendar();
-  },
-
   _renderCalendar() {
     const calendarNode = document.getElementById("upcoming-events-calendar");
     if (!calendarNode) {
@@ -42,11 +36,6 @@ export default Component.extend({
 
     calendarNode.innerHTML = "";
 
-    if (this._calendar) {
-      this._calendar.destroy();
-      this._calendar = null;
-    }
-
     this._loadCalendar().then(() => {
       this._calendar = new window.FullCalendar.Calendar(calendarNode, {});
 
diff --git a/assets/javascripts/discourse/controllers/discourse-post-event-upcoming-events-index.js.es6 b/assets/javascripts/discourse/controllers/discourse-post-event-upcoming-events-index.js.es6
index 2798327..fa4ba1e 100644
--- a/assets/javascripts/discourse/controllers/discourse-post-event-upcoming-events-index.js.es6
+++ b/assets/javascripts/discourse/controllers/discourse-post-event-upcoming-events-index.js.es6
@@ -1,16 +1,3 @@
 import Controller from "@ember/controller";
-import { inject } from "@ember/controller";
 
-export default Controller.extend({
-  exceptionController: inject("exception"),
-
-  loadEvents(params) {
-    this.store
-      .findAll("discourse-post-event-event", params)
-      .then(events => this.set("events", events))
-      .catch(e => {
-        this.exceptionController.set("thrown", e.jqXHR);
-        this.replaceRoute("exception");
-      });
-  }
-});
+export default Controller.extend({});
diff --git a/assets/javascripts/discourse/routes/discourse-post-event-upcoming-events-index.js.es6 b/assets/javascripts/discourse/routes/discourse-post-event-upcoming-events-index.js.es6
index bfe4fdd..dbd08ee 100644
--- a/assets/javascripts/discourse/routes/discourse-post-event-upcoming-events-index.js.es6
+++ b/assets/javascripts/discourse/routes/discourse-post-event-upcoming-events-index.js.es6
@@ -3,10 +3,6 @@ import Route from "@ember/routing/route";
 import { on } from "@ember/object/evented";
 
 export default Route.extend({
-  queryParams: {
-    invited: { refreshModel: true, replace: true }
-  },
-
   enforcePostEventEnabled: on("activate", function() {
     if (!this.siteSettings.discourse_post_event_enabled) {
       DiscourseURL.redirectTo("/404");
@@ -14,10 +10,6 @@ export default Route.extend({
   }),
 
   model(params) {
-    return params;
-  },
-
-  setupController(controller, params) {
-    controller.loadEvents(params);
+    return this.store.findAll("discourse-post-event-event", params);
   }
 });
diff --git a/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs b/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs
index 057a4d2..a5bf6aa 100644
--- a/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs
+++ b/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs
@@ -1,3 +1,3 @@
 <div class="discourse-post-event-upcoming-events">
-  {{upcoming-events-calendar events=events}}
+  {{upcoming-events-calendar events=model}}
 </div>

GitHub sha: ac4784ba