Skip to content

Commit

Permalink
updated readme message to warn about the academy id on the querysintr
Browse files Browse the repository at this point in the history
  • Loading branch information
alesanchezr committed Jan 6, 2023
1 parent 6708f5c commit a738ed9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const Main = injectContent(() => {
const sortedDays = store.days.sort((a, b) => (a.position < b.position ? -1 : 1));
const notInfoEmpty = key => store.info[key] && store.info[key] !== undefined && store.info[key] != "";

const readOnly = store.info?.academy_author != params.get("academy");
const academyFromUrl = params.get("academy");
const readOnly = (!academyFromUrl && typeof academyFromUrl == undefined) || store.info?.academy_author != params.get("academy");

useEffect(() => {
actions.getMe();
Expand Down Expand Up @@ -88,7 +89,10 @@ const Main = injectContent(() => {
<Notifier />
<TopBar readOnly={readOnly} />
{readOnly ? (
<div className="alert alert-warning m-0 rounded-0">You cannot update this syllabus, read only mode is active.</div>
<div className="alert alert-warning m-0 rounded-0">
{!academyFromUrl && <p className="m-0">Please specify your academy id on the URL QueryString.</p>}
<span>You cannot update this syllabus, read only mode is active.</span>
</div>
) : (
<div className="hbar" />
)}
Expand Down

1 comment on commit a738ed9

@vercel
Copy link

@vercel vercel bot commented on a738ed9 Jan 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.