Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
const {entities, teamId} = this.props;
const views = {
extension: {
selectedTeamId: teamId,
},
};
const state = {entities, views};
const publicChannels = getExtensionSortedPublicChannels(state);
const privateChannels = getExtensionSortedPrivateChannels(state);
const directChannels = getExtensionSortedDirectChannels(state);
const icons = await Promise.all([
Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
]);
this.publicChannelIcon = icons[0];
this.privateChannelIcon = icons[1];
this.dmChannelIcon = icons[2];
this.gmChannelIcon = icons[3];
this.setState({
publicChannels,
privateChannels,
directChannels,
}, () => {
this.buildSections();
});
} catch (error) {
componentWillMount() {
Icon.getImageSource('android', 36, '#92c029').then((source) => {
this.setState({
appLogo: source
})
});
}
componentDidMount() {
trackScreenView('Event Map - ' + this.props.event.name);
Icon
.getImageSource('map-o', 20, 'white')
.then((mapIcon) => {
this.props.navigator.setButtons({
rightButtons: [
{
id: 'directions',
icon: mapIcon
}
]
});
});
}
loadChannels = async () => {
try {
const {entities, teamId} = this.props;
const views = {
extension: {
selectedTeamId: teamId,
},
};
const state = {entities, views};
const publicChannels = getExtensionSortedPublicChannels(state);
const privateChannels = getExtensionSortedPrivateChannels(state);
const directChannels = getExtensionSortedDirectChannels(state);
const icons = await Promise.all([
Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
]);
this.publicChannelIcon = icons[0];
this.privateChannelIcon = icons[1];
this.dmChannelIcon = icons[2];
this.gmChannelIcon = icons[3];
this.setState({
publicChannels,
privateChannels,
directChannels,
}, () => {
this.buildSections();
componentDidMount() {
trackScreenView('Event Detail - ' + this.props.event.name);
let shareIcon = Platform.OS === 'ios' ? 'share-square-o' : 'share-alt';
Icon
.getImageSource(shareIcon, 20, 'white')
.then((mapIcon) => {
this.props.navigator.setButtons({
rightButtons: [
{
id: 'share',
icon: mapIcon
}
]
});
});
}
constructor(props) {
super(props);
this.state = {
userIcon: null,
showError: false,
errorText: null
};
Icon.getImageSource('user', 50, '#999').then((source) => {
this.setState({
userIcon: source
})
})
}
componentDidMount() {
Icon.getImageSource('user', 24, 'red').then(source => {
this.setState({ iconUri: source.uri })
});
}
loadChannels = async () => {
try {
const {entities, teamId} = this.props;
const views = {
extension: {
selectedTeamId: teamId,
},
};
const state = {entities, views};
const publicChannels = getExtensionSortedPublicChannels(state);
const privateChannels = getExtensionSortedPrivateChannels(state);
const directChannels = getExtensionSortedDirectChannels(state);
const icons = await Promise.all([
Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
]);
this.publicChannelIcon = icons[0];
this.privateChannelIcon = icons[1];
this.dmChannelIcon = icons[2];
this.gmChannelIcon = icons[3];
this.setState({
publicChannels,
privateChannels,
directChannels,
}, () => {
this.buildSections();
});
const {entities, teamId} = this.props;
const views = {
extension: {
selectedTeamId: teamId,
},
};
const state = {entities, views};
const publicChannels = getExtensionSortedPublicChannels(state);
const privateChannels = getExtensionSortedPrivateChannels(state);
const directChannels = getExtensionSortedDirectChannels(state);
const icons = await Promise.all([
Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
]);
this.publicChannelIcon = icons[0];
this.privateChannelIcon = icons[1];
this.dmChannelIcon = icons[2];
this.gmChannelIcon = icons[3];
this.setState({
publicChannels,
privateChannels,
directChannels,
}, () => {
this.buildSections();
});
} catch (error) {
this.setState({error});