Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onSearchedClick = (selectedItem) => {
if (selectedItem.is_dir === true) {
let url = siteRoot + 'library/' + selectedItem.repo_id + '/' + selectedItem.repo_name + selectedItem.path;
navigate(url, {repalce: true});
} else {
let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + Utils.encodePath(selectedItem.path);
let newWindow = window.open('about:blank');
newWindow.location.href = url;
}
}
const handleSave = async (event: any) => {
event.preventDefault();
setIsSaving(true);
const { noteId, noteContent } = props;
const updateNoteURL = `${config.GatewayURL}/notes/${noteId}`;
try {
await fetch(updateNoteURL, {
method: "PUT",
body: JSON.stringify({ content: noteContent })
});
navigate("/");
} catch (error) {
setErrorMsg(`${error.toString()} - ${updateNoteURL} - ${noteContent}`);
} finally {
setIsSaving(false);
}
};
function navigateToAlbum() {
const { id } = album;
navigate(`/album/${id}`);
}
function handleAlbumPlay(e) {
const previousSlide = ({ slug, index, metadata, setState }) => {
const n = index - 1
if (n < 0) return
navigate([slug, n].join('/'))
const { steps = 0 } = metadata[n] || {}
setState({ step: steps })
}
onClick={() => {
navigate(translateLink("advanced-usage", currentLanguage))
}}
style={{ margin: "40px auto" }}
useEffect(() => {
if (authenticate) {
navigate(`/gtas/tools/about`, true);
}
}, [authenticate, failedLogin]);
function clearExploreParams() {
navigate(`?#study-visualize`)
}
function handleSearch() {
navigate(`/search/results/${searchTerm}`);
}
.then(() => {
navigate("/")
})
.catch(updateError => {
onSearchedClick = (selectedItem) => {
if (selectedItem.is_dir === true) {
let url = siteRoot + 'library/' + selectedItem.repo_id + '/' + selectedItem.repo_name + selectedItem.path;
navigate(url, {repalce: true});
} else {
let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + Utils.encodePath(selectedItem.path);
let newWindow = window.open('about:blank');
newWindow.location.href = url;
}
}