Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.socket.emit('settings', (e, data) => {
this.settings = {
widgetEventlistFollows: isNil(data.widgetEventlistFollows) ? true : data.widgetEventlistFollows,
widgetEventlistHosts: isNil(data.widgetEventlistHosts) ? true : data.widgetEventlistHosts,
widgetEventlistRaids: isNil(data.widgetEventlistRaids) ? true : data.widgetEventlistRaids,
widgetEventlistCheers: isNil(data.widgetEventlistCheers) ? true : data.widgetEventlistCheers,
widgetEventlistSubs: isNil(data.widgetEventlistSubs) ? true : data.widgetEventlistSubs,
widgetEventlistSubgifts: isNil(data.widgetEventlistSubgifts) ? true : data.widgetEventlistSubgifts,
widgetEventlistSubcommunitygifts: isNil(data.widgetEventlistSubcommunitygifts) ? true : data.widgetEventlistSubcommunitygifts,
widgetEventlistResubs: isNil(data.widgetEventlistResubs) ? true : data.widgetEventlistResubs,
widgetEventlistTips: isNil(data.widgetEventlistTips) ? true : data.widgetEventlistTips
}
this.eventlistShow = data.widgetEventlistShow
this.eventlistSize = data.widgetEventlistSize,
this.eventlistMessageSize = data.widgetEventlistMessageSize
console.group('Eventlist widgets settings')
console.debug(this.settings)
console.groupEnd()
})
this.socket.emit('get') // get initial widget state
private isMatch(node: ListboxItemProps): boolean {
if (!isNil(this.storedValueString)) {
return node.value
.toLowerCase()
.includes(this.storedValueString.toLowerCase());
}
}
private hasGlyphAndContent(): boolean {
return this.state.selected
? !isNil(this.props.selectedGlyph) && !isNil(this.props.selectedContent)
: !isNil(this.props.unselectedGlyph) && !isNil(this.props.unselectedContent);
}
const isSearchInResponse = o.responses.filter(o => {
return !isNil(o.response.match(new RegExp(this.search, 'ig')))
}).length > 0
return isSearchInCommand || isSearchInResponse
private hasGlyphAndContent(): boolean {
return this.state.selected
? !isNil(this.props.selectedGlyph) && !isNil(this.props.selectedContent)
: !isNil(this.props.unselectedGlyph) && !isNil(this.props.unselectedContent);
}
private hasBeforeOrAfterAndChildren(): boolean {
return (
!isNil(this.props.children) &&
(!isNil(this.props.beforeContent) || !isNil(this.props.afterContent))
);
}
}
const Annotation = ({ children, title }) =>
_.isNil(children) ? null : (
<>
<dt>{title}</dt>
<dd>{children}</dd>
);
export const CSVSubscription: React.FC = (props) => {
const EmptyMsg = () => ;
const subscription = props.subscription
.filter(sub => sub.metadata.namespace === (props.obj.metadata.annotations || {})['olm.operatorNamespace'])
.find(sub => _.get(sub.status, 'installedCSV') === props.obj.metadata.name);
return
status.packageName === subscription.spec.name && status.catalogSource === subscription.spec.source && status.catalogSourceNamespace === subscription.spec.sourceNamespace)
: null} />
;
};
export const decodeUrl = (url: string) => {
const urlParameters = new URLSearchParams(url);
if (urlParameters.has("saved")) {
const savedParameter = urlParameters.get("saved");
if (isNil(savedParameter)) {
return undefined;
}
const decompressed = lzString.decompressFromEncodedURIComponent(
savedParameter
);
return JSON.parse(decompressed);
}
return undefined;
};