Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidCatch(error: Error, info: {}) {
// TIPS: Many times DidCatch is because the JS file can't be retrieved, so refresh it first.
const qs = queryString.parse(window.location.search);
if (!qs[CATCH_HAS_REFRESH_URL_PARAM]) {
window.location.href = urlUtil.mergeParamToUrlQuery({
window,
params: { [CATCH_HAS_REFRESH_URL_PARAM]: 1 },
replace: false,
});
}
console.log('---- ALL-STACK ----', info, error);
this.setState({ errorInfo: error.message });
}
const Search = ({
geral,
match,
location,
getMoviesSearch,
clearMovies,
movies,
}) => {
const { query } = match.params;
const params = queryString.parse(location.search);
const { secure_base_url } = geral.base.images;
// Fetch movies hook
useFetchMoviesSearch(query, getMoviesSearch, params, clearMovies);
// If loading
if (movies.loading) {
return ;
}
//If there are no results
else if (movies.total_results === 0) {
return (
static getDerivedStateFromProps(props, state) {
const parsed = qs.parse(window.location.search)
// Parse selected lesson from query string, so we don't have to deal with real /routing.
return {
...state,
selectedLesson: parseInt(parsed.lesson) || 1,
startAt: parseInt(parsed.t, 10)
}
}
componentDidMount: function() {
var self = this;
if (window) {
var params = qs.parse(window.location.search);
this.setState(params);
}
this.initBumpkit();
if (document) {
document.onkeydown = function(e) {
//console.log(e.which);
switch (e.which) {
case 32:
e.preventDefault();
self.playPause();
break;
default:
break;
}
};
}
throw new Error('matchRoutes requires routes to be an object.');
}
if (typeof url !== 'string') {
throw new Error('matchRotes requires url to be a string.');
}
const urlWithQueryString = url.split('#')[0];
const pathname = urlWithQueryString.split('?')[0];
const match = deepMatchRoutes(routes, pathname, pathname);
if (match) {
const queryStringAndHash = url.substring(pathname.length);
const queryString = queryStringAndHash.split('#')[0];
const query = queryStringParser.parse(queryString);
return {
...match,
query
};
}
return null;
};
goTo(store, paramsArr) {
const paramsObject = this.getParamsObject(paramsArr);
const queryParamsObject = queryString.parse(window.location.search);
store.router.goTo(this, paramsObject, store, queryParamsObject);
}
}
initContractTableStore() {
const parsed = queryString.parse(this.props.location.search)
contractTableStore.initFromUrlParams(this.props.abiLoader, this.props.accountName, parsed)
}
export const createAdjustedQueryString = (
location: Location,
newParams: { [key: string]: string | number | boolean | undefined },
) => {
const query = queryString.parse(location.search);
return `?${queryString.stringify({ ...query, ...newParams })}`;
};
static fetchData = (getState, dispatch, location, match) => {
const params = queryString.parse(location.search);
const promise = ReadingGroupsMembersContainer.fetchMembers(
dispatch,
params.page,
match
);
return Promise.all([promise]);
};
const potCtx = potCanvas.getContext('2d')
const bg = createBackground()
app.scene.add(bg)
let time = 0
app.on('tick', (dt) => {
time += dt / 1000
const [ width, height ] = app.shape
bg.style({
aspect: width / height
})
})
const smooth = qs.parse(window.location.search).smooth === 'true'
const geometry = new THREE.TorusKnotGeometry(0.45, 0.25, 128, 256)
const material = createMaterial(!smooth)
const mesh = new THREE.Mesh(geometry, material)
app.scene.add(mesh)
const random = require('unique-random-array')([
[14.584186, 120.979963],
[27.175515, 78.04145199999994],
[10.642237, 122.23580400000003],
[17.571335, 120.388777],
[68.196537, 13.531821000000036],
[0.203972, 37.45297400000004],
[30.185036, -84.724629],
[41.403286, 2.1746729999999843],
[60.070408, 6.542394000000058]