Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidUpdate(prevProps){
if (this.props.proposal != prevProps.proposal){
// console.log(this.props.proposal.value);
this.setState({
proposal: this.props.proposal,
deposit: <div>{this.props.proposal.total_deposit?this.props.proposal.total_deposit.map((deposit, i) => {
return <div>{new Coin(deposit.amount).toString()}</div>
}):''} </div>
});
let now = moment();
const powerReduction = Meteor.settings.public.powerReduction || Meteor.settings.public.stakingFraction;
let totalVotingPower = this.props.chain.activeVotingPower * powerReduction;
if (this.props.proposal.voting_start_time != '0001-01-01T00:00:00Z'){
if (now.diff(moment(this.props.proposal.voting_start_time)) > 0){
let endVotingTime = moment(this.props.proposal.voting_end_time);
if (now.diff(endVotingTime) < 0){
// not reach end voting time yet
let totalVotes = 0;
for (let i in this.props.proposal.tally){
totalVotes += parseInt(this.props.proposal.tally[i]);
}
this.setState({
tally: this.props.proposal.tally,
tallyDate: ,
voteStarted: true,
voteEnded: false,
issueObj['points'] = points;
} else if (pointsExp.test(currentLabel.node.description)) {
let points = parseInt(currentLabel.node.description.replace('SP:', ''));
issueObj['points'] = points;
} else if (
Meteor.settings.public.labels.effort !== undefined &&
Meteor.settings.public.labels.effort[currentLabel.node.name] !==
undefined &&
Number.isInteger(
Meteor.settings.public.labels.effort[currentLabel.node.name]
)
) {
// Interesting edge case, if the label is actually named "constructor"
// Added this check: Number.isInteger(Meteor.settings.public.labels.effort[currentLabel.node.name])
issueObj['points'] = parseInt(
Meteor.settings.public.labels.effort[currentLabel.node.name]
);
/*
if (Meteor.settings.public.labels.effort !== undefined) {
const pointsLabel = pointsLabelExp.exec(currentLabel.node.name);
const efforts = Meteor.settings.public.labels.effort;
if (efforts[pointsLabel.groups.name] !== undefined) {
issueObj['points'] = efforts[pointsLabel.groups.name];
}
}
*/
}
if (boardExp.test(currentLabel.node.description)) {
const boardLabel = boardExp.exec(currentLabel.node.description);
issueObj['boardState'] = {
name: boardLabel.groups.name,
priority: boardLabel.groups.priority,
function healthCron() {
// Set up cron job unless in testing mode or it's explicitly disabled in settings file.
const testMode = Meteor.isTest || Meteor.isAppTest;
const disabled = Meteor.settings.healthCron && !Meteor.settings.healthCron.enabled;
if (disabled) {
console.log('Health cron job disabled in view.config.json.');
}
if (!testMode && !disabled) {
// Default the update interval to 10 seconds if not supplied in configuration file.
const updateIntervalSeconds = Meteor.settings.systemStats ? Meteor.settings.systemStats.updateIntervalSeconds : 10;
const services = ['MAUKA', 'MAKAI', 'MONGO', 'HEALTH'];
SyncedCron.add({
name: 'Check Health collection for services that are down',
schedule(parser) {
return parser.text(`every ${updateIntervalSeconds} seconds`); // Seconds must be between 0-59.
},
job() {
const usersInterested = UserProfiles.find({ 'notification_preferences.notification_types':
'system service down' }).fetch();
const healths = Healths.find(
Meteor.settings.public.showResendVerificationEmailLink =
(Meteor.settings.email && Meteor.settings.email.showResendVerificationEmailLink !== undefined)
? Meteor.settings.email.showResendVerificationEmailLink
: false;
Meteor.settings.public.showForgotPasswordLink =
(Meteor.settings.email && Meteor.settings.email.showForgotPasswordLink !== undefined)
? Meteor.settings.email.showForgotPasswordLink
: false;
Meteor.settings.public.isEnd2EndTest = Meteor.settings.isEnd2EndTest;
// enforce slash "/" at the end
if (Meteor.settings.attachments && Meteor.settings.attachments.storagePath) {
if (! Meteor.settings.attachments.storagePath.match(/\/$/)) {
Meteor.settings.attachments.storagePath = Meteor.settings.attachments.storagePath + '/';
}
}
LdapSettings.publish();
}
Meteor.startup(() => {
const REDIS_CONFIG = Meteor.settings.redis;
RedisPubSubSingleton.updateConfig(REDIS_CONFIG);
RedisPubSubSingleton.init();
});
Meteor.startup(() => {
Fiber(() => cacheRegisteredLocales(resourceSlug)).run();
if (get(Meteor.settings, 'transifex.skipSyncingOnStart')) {
console.log('Skipping automatic transifex syncing on server start.');
return;
}
Fiber(() => syncPropertyNamesWithTransifex()).run();
});
constructor(props){
super(props);
this.state = {
limit: Meteor.settings.public.initialPageSize,
monikerDir: 1,
votingPowerDir: -1,
uptimeDir: -1,
proposerDir: -1,
priority: 2,
loadmore: false,
sidebarOpen: (props.location.pathname.split("/transactions/").length == 2)
}
this.onSetSidebarOpen = this.onSetSidebarOpen.bind(this);
}
Meteor.startup(function() {
Meteor.setInterval(intervalCheck, Meteor.settings.public.intervalTimer);
});
export default function validateAuthToken(credentials) {
const REDIS_CONFIG = Meteor.settings.redis;
const CHANNEL = REDIS_CONFIG.channels.toBBBApps.meeting;
const EVENT_NAME = 'validate_auth_token';
const { meetingId, requesterUserId, requesterToken } = credentials;
check(meetingId, String);
check(requesterUserId, String);
check(requesterToken, String);
const User = Users.findOne({
meetingId,
userId: requesterUserId,
});
if (!User) {
createDummyUser(meetingId, requesterUserId, requesterToken);
disablePublic: () => Meteor.settings.public.disablePublic,
archived: (_id) => (Projects.findOne({ _id }) ? Projects.findOne({ _id }).archived : false),