From 443fdc3ec64fe96a443bdafe9dc41c68d370512b Mon Sep 17 00:00:00 2001 From: Justin DiRose Date: Mon, 30 Nov 2020 10:35:21 -0600 Subject: [PATCH] DEV: Transition from Ember constant to imports (#34) --- assets/javascripts/discourse/controllers/s-show.js.es6 | 3 ++- assets/javascripts/discourse/models/plan.js.es6 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/controllers/s-show.js.es6 b/assets/javascripts/discourse/controllers/s-show.js.es6 index 73755af..7a999fe 100644 --- a/assets/javascripts/discourse/controllers/s-show.js.es6 +++ b/assets/javascripts/discourse/controllers/s-show.js.es6 @@ -2,10 +2,11 @@ import Controller from "@ember/controller"; import Subscription from "discourse/plugins/discourse-subscriptions/discourse/models/subscription"; import Transaction from "discourse/plugins/discourse-subscriptions/discourse/models/transaction"; import I18n from "I18n"; +import { not } from "@ember/object/computed"; export default Controller.extend({ selectedPlan: null, - isAnonymous: Ember.computed.not("currentUser"), + isAnonymous: not("currentUser"), init() { this._super(...arguments); diff --git a/assets/javascripts/discourse/models/plan.js.es6 b/assets/javascripts/discourse/models/plan.js.es6 index bcbcfda..2b7571b 100644 --- a/assets/javascripts/discourse/models/plan.js.es6 +++ b/assets/javascripts/discourse/models/plan.js.es6 @@ -1,8 +1,9 @@ import EmberObject from "@ember/object"; import discourseComputed from "discourse-common/utils/decorators"; +import { computed } from "@ember/object"; const Plan = EmberObject.extend({ - amountDollars: Ember.computed("unit_amount", { + amountDollars: computed("unit_amount", { get() { return parseFloat(this.get("unit_amount") / 100).toFixed(2); },