Skip to content

Commit

Permalink
v2.2.6 (#46) (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoldello authored Sep 20, 2023
1 parent 30552f8 commit 0b22147
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
titleCase,
showCustomValidityError,
stringToInteger,
isProduction,
useMount,
} from './utils';
import {
Expand Down Expand Up @@ -847,7 +848,7 @@ useEffect(() => {

return <>
<div className="home-region">
<a href="/">
<a href={isProduction() ? '/rec_to_nwb_yaml_creator' : '/'}>
<img src={logo} alt="Loren Frank Lab logo"/>
</a>
</div>
Expand Down
13 changes: 13 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,16 @@ export const sanitizeTitle = (title) => {
.trim()
.replace(/[^a-z0-9]/gi, '');
};


/**
* Checks if running in Production
*
* @returns True if running in Production, false otherwise
*/
export const isProduction = () => {
// It is better to use node.js. But that requires adding a package.
// See - https://stackoverflow.com/a/70989566/178550. This is sufficient for
// now but can be updated if the need arises
return window.location.href.includes('https://lorenfranklab.github.io');
};

0 comments on commit 0b22147

Please sign in to comment.