Get org errors

This commit is contained in:
Rotimi Best
2023-05-16 16:30:30 +01:00
parent 68e1dbb1b5
commit 150fa92005
2 changed files with 16 additions and 6 deletions
+5 -2
View File
@@ -151,10 +151,13 @@
if (typeof window !== 'undefined') {
const debug = localStorage.getItem('role') === 'student';
const matches = host.match(/([a-z0-9]+).*classroomio[.]com/);
const answer = Array.isArray(matches) ? !!matches[1] : false;
const subdomain = matches?.[1] ?? '';
const answer = Array.isArray(matches)
? !!subdomain && subdomain !== 'www'
: false;
$appStore.isStudentDomain = debug || answer;
$appStore.siteNameFromDomain = debug ? 'codingdojo' : matches?.[1] ?? '';
$appStore.siteNameFromDomain = debug ? 'codingdojo' : subdomain;
}
}