From 575d9e0b1a46f8b86b5ba1285ea5b16a8e11b1d3 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 8 Aug 2018 10:09:22 +0100 Subject: [PATCH] FIX: Include parameters in function call --- .../controllers/preferences/second-factor.js.es6 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 index e483885c912..29ef5626368 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/second-factor.js.es6 @@ -2,6 +2,7 @@ import { default as computed } from "ember-addons/ember-computed-decorators"; import { default as DiscourseURL, userPath } from "discourse/lib/url"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { findAll } from "discourse/models/login-method"; +import { getOwner } from "discourse-common/lib/get-owner"; export default Ember.Controller.extend({ loading: false, @@ -33,7 +34,13 @@ export default Ember.Controller.extend({ @computed displayOAuthWarning() { - return findAll().length > 0; + return ( + findAll( + this.siteSettings, + getOwner(this).lookup("capabilities:main"), + this.site.isMobileDevice + ).length > 0 + ); }, toggleSecondFactor(enable) {