Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getCommunitiesList: (auth) => {
const uuid = shortId();
dispatch(ca.getListInit(uuid));
dispatch(ca.getListDone(uuid, auth));
},
submit: (tokenV3, tokenV2, submissionId, body, track) => {
try {
res = await resolveMediaUrl(url)
} catch (e) {
console.error(e)
}
if (!res) {
console.log(`Failed to fetch media for ${url}`)
return null
}
console.log('Media response', res)
const userId = context.client.id.toString()
const media: IMediaItem = {
id: shortid(),
type: res.type,
url: res.url,
title: res.title || res.url,
duration: res.duration,
description: res.description,
imageUrl: res.thumbnails && res.thumbnails[MediaThumbnailSize.Default],
requestUrl: url,
ownerId: userId,
ownerName: getUserName(getState(), userId),
hasMore: res.hasMore
}
if (res.state) {
media.state = res.state
}
getReviewOpportunities: (page, token) => {
const uuid = shortId();
dispatch(a.getReviewOpportunitiesInit(uuid, page));
dispatch(a.getReviewOpportunitiesDone(uuid, page, token));
},
selectBucket: bucket => dispatch(sa.selectBucket(bucket)),
subTokens.forEach((st) => {
switch (st.type) {
case 'link_open': {
const id = shortId().replace(/-/g, ':');
this.hrefs[id] = st.attrs[0][1];
styles.push(`a:${id}`);
break;
}
case 'em_open':
case 'strong_open':
styles.push(st.tag);
break;
case 's_open':
styles.push('strike');
break;
case 'em_close':
case 'link_close':
cancelOrder = (params = {}) =>
this.requestTrading(`/cancel_order`, `post`, {
cancelRequestClientOrderId: shortid(),
...params,
});
addBookmark(bookmark: Bookmark) {
this._store$.dispatch(new AddBookmark({
bookmark: {
...bookmark,
id: shortid()
}
}));
}
export const getData = data => ({
url: null,
textPosition: 'topleft',
color: '#000',
bgColor: '#fff',
center: false,
image: null,
byline: null,
kind: 'editorial',
titleSize: 'standard',
teaserType: 'frontImage',
reverse: false,
portrait: true,
showImage: true,
onlyImage: false,
id: (data && data.id) || shortId(),
...data || {}
})
return state.map((item) => {
if (item.id === action.payload.id) {
const updatedTask: Task = Object.assign({}, item);
const newTask: Task = {
id: shortid(),
parentId: item.id,
title: '',
isDone: false
};
if (!updatedTask.subTasks) {
updatedTask.subTasks = [newTask];
} else {
updatedTask.subTasks.push(newTask);
}
return updatedTask;
} else {
return item;
}
import * as moment from 'moment';
import {dotAnimation} from './dot.ani';
import {T} from '../../../t.const';
@Component({
selector: 'input-duration-slider',
templateUrl: './input-duration-slider.component.html',
styleUrls: ['./input-duration-slider.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [dotAnimation],
})
export class InputDurationSliderComponent implements OnInit, OnDestroy {
T = T;
minutesBefore = 0;
dots: any[];
uid: string = 'duration-input-slider' + shortid();
el: HTMLElement;
startHandler: (ev: any) => void;
endHandler: () => void;
moveHandler: (ev: any) => void;
@ViewChild('circleEl', {static: true}) circleEl: ElementRef;
@Input() label: string;
@Output() modelChange: EventEmitter = new EventEmitter();
constructor(
private _el: ElementRef,
private _cd: ChangeDetectorRef,
) {
this.el = _el.nativeElement;
constructor(name, job) {
this.name = name;
this.id = shortid();
this.progress = 0;
this.status = {
pending: true,
string: 'pending'
};
this._job = job;
}
run() {