mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Merge branch 'master' of github.com:coralproject/talk into featured-comments
This commit is contained in:
@@ -7,8 +7,12 @@ import pym from '../services/PymConnection';
|
|||||||
|
|
||||||
import {resetWebsocket} from 'coral-framework/services/client';
|
import {resetWebsocket} from 'coral-framework/services/client';
|
||||||
import t from 'coral-framework/services/i18n';
|
import t from 'coral-framework/services/i18n';
|
||||||
|
import {isSlotEmpty} from 'plugin-api/beta/client/services';
|
||||||
|
|
||||||
export const showSignInDialog = () => (dispatch, getState) => {
|
export const showSignInDialog = () => (dispatch, getState) => {
|
||||||
|
if (isSlotEmpty('login')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const signInPopUp = window.open(
|
const signInPopUp = window.open(
|
||||||
'/embed/stream/login',
|
'/embed/stream/login',
|
||||||
'Login',
|
'Login',
|
||||||
|
|||||||
@@ -12,17 +12,19 @@ import camelize from './camelize';
|
|||||||
|
|
||||||
function getSlotComponents(slot) {
|
function getSlotComponents(slot) {
|
||||||
const pluginConfig = getStore().getState().config.plugin_config;
|
const pluginConfig = getStore().getState().config.plugin_config;
|
||||||
|
|
||||||
|
// Filter out components that have been disabled in `plugin_config`
|
||||||
return flatten(plugins
|
return flatten(plugins
|
||||||
|
|
||||||
// Filter out components that have been disabled in `plugin_config`
|
// 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])
|
.filter((o) => o.module.slots[slot])
|
||||||
.map((o) => o.module.slots[slot]));
|
.map((o) => o.module.slots[slot]));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isSlotEmpty(slot) {
|
export function isSlotEmpty(slot) {
|
||||||
return !!getSlotComponents(slot).length;
|
return getSlotComponents(slot).length === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "talk",
|
"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",
|
"description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user