Skip to content

Commit

Permalink
Fixing bugs, adding forgotten images, removing unused stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Jan 4, 2025
1 parent 43d6b61 commit 6b9e12c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion etc/env.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"PORT": 8080,
"URL_PATH_PREFIX": "",
"API_BASE": "https://siscodex.base.domain/api",
"RECODEX_URI:": "https://recodex.webapp.domain",
"RECODEX_URI": "https://recodex.webapp.domain",
"TITLE": "SIS-CodEx",
"SKIN": "success",
"PERSISTENT_TOKENS_KEY_PREFIX": "recodex-sis"
Expand Down
Binary file added public/public/favicon.ico
Binary file not shown.
Binary file added public/public/logo-bare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/helpers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { safeGet, canUseDOM } from './common.js';
export const getConfigVar = name => {
let MY_VAR = '';
if (canUseDOM) {
MY_VAR = safeGet(window, ['__RECODEX_CONFIG__', name], '');
MY_VAR = safeGet(window, ['__SISCODEX_CONFIG__', name], '');
} else {
MY_VAR = JSON.parse(fs.readFileSync('etc/env.json', 'utf8'))[name] || '';
}
Expand Down
6 changes: 5 additions & 1 deletion src/pages/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ const getRedirect = (routeObj, urlPath, isLoggedIn) => {
*/
export const match = (urlPath, isLoggedIn) => {
const routeObj = routesDescriptors.find(({ route }) => matchPath(route, urlPath) !== null);
const component = routeObj && unwrap(routeObj.component);
if (!routeObj) {
return {};
}

const component = unwrap(routeObj.component);

const redirect = getRedirect(routeObj, urlPath, isLoggedIn);
const match = matchPath(routeObj.route, urlPath);
Expand Down
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ app.get('*', (req, res) => {
*/

const userId = loggedInUserIdSelector(store.getState()); // try to get the user ID from the token (if any)
const { redirect /*, params, loadAsync */ } = match(location, Boolean(userId));
const { redirect = null /*, params, loadAsync */ } = match(location, Boolean(userId));

if (redirect) {
res.redirect(302, redirect);
Expand Down
9 changes: 2 additions & 7 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="<%= urlPrefix %>/public/favicon.ico" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/default.min.css">
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css"
Expand Down Expand Up @@ -72,13 +69,11 @@
</head>

<body class="loading" style="height: auto">
<div id="loading-screen">
<%= ((new Date()).getMonth() === 3 && (new Date()).getDate() === 1) ? 'Loudím' : 'Loading' %>...
</div>
<div id="loading-screen">Loading...</div>

<div id="root"></div>
<script>
window.__RECODEX_CONFIG__ = <%- config %>;
window.__SISCODEX_CONFIG__ = <%- config %>;
</script>
<script src="<%= bundle %>"></script>
<script>
Expand Down

0 comments on commit 6b9e12c

Please sign in to comment.