From fd1f8b24c141fb3987b085762b5863b49b57f772 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 3 Jul 2017 19:33:33 +0700 Subject: [PATCH 1/3] Don't show popup when empty --- client/coral-framework/actions/auth.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/coral-framework/actions/auth.js b/client/coral-framework/actions/auth.js index 05e078010..53d0f1212 100644 --- a/client/coral-framework/actions/auth.js +++ b/client/coral-framework/actions/auth.js @@ -7,8 +7,12 @@ import pym from '../services/PymConnection'; import {resetWebsocket} from 'coral-framework/services/client'; import t from 'coral-framework/services/i18n'; +import {isSlotEmpty} from 'plugin-api/beta/client/services'; export const showSignInDialog = () => (dispatch, getState) => { + if (isSlotEmpty('login')) { + return; + } const signInPopUp = window.open( '/embed/stream/login', 'Login', From cfa7a74742d77307fa1f94d6c9bf16bd681ac189 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 4 Jul 2017 22:22:52 +0700 Subject: [PATCH 2/3] Fix isSlotEmpty logic and handle empty plugin_config --- client/coral-framework/helpers/plugins.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/coral-framework/helpers/plugins.js b/client/coral-framework/helpers/plugins.js index bb21bef6c..ab5e3080e 100644 --- a/client/coral-framework/helpers/plugins.js +++ b/client/coral-framework/helpers/plugins.js @@ -12,17 +12,19 @@ import camelize from './camelize'; function getSlotComponents(slot) { const pluginConfig = getStore().getState().config.plugin_config; + + // Filter out components that have been disabled in `plugin_config` return flatten(plugins // Filter out components that have been disabled in `plugin_config` - .filter((o) => !pluginConfig[o.plugin] || !pluginConfig[o.plugin].disable_components) + .filter((o) => !pluginConfig || !pluginConfig[o.plugin] || !pluginConfig[o.plugin].disable_components) .filter((o) => o.module.slots[slot]) .map((o) => o.module.slots[slot])); } export function isSlotEmpty(slot) { - return !!getSlotComponents(slot).length; + return getSlotComponents(slot).length === 0; } /** From f94c36e9c9e71dff81d3ab5a0c194e35970329eb Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Wed, 5 Jul 2017 11:43:18 +0100 Subject: [PATCH 3/3] Update version 2.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a0040783a..382846cef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "talk", - "version": "2.2.0", + "version": "2.2.1", "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "scripts": {