style fixes

This commit is contained in:
Thomas Karolski 2022-03-14 17:51:10 +01:00
parent 87af7a36cd
commit ccdd551b4d
2 changed files with 4 additions and 3 deletions

View File

@ -100,7 +100,7 @@ export function getRequestProfile(req: Request): UserProfile|undefined {
let profile: UserProfile|undefined; let profile: UserProfile|undefined;
if (header && req.headers && req.headers[header]) { if (header && req.headers && req.headers[header]) {
let headerContent = req.headers[header]; const headerContent = req.headers[header];
if (headerContent) { if (headerContent) {
const userEmail = headerContent.toString(); const userEmail = headerContent.toString();
const [userName] = userEmail.split("@", 1); const [userName] = userEmail.split("@", 1);

View File

@ -157,10 +157,11 @@ Comm.prototype._broadcastMessage = function(type, data, clients) {
*/ */
Comm.prototype._getSessionProfile = function(scopedSession, req) { Comm.prototype._getSessionProfile = function(scopedSession, req) {
const profile = getRequestProfile(req); const profile = getRequestProfile(req);
if (profile) if (profile) {
return Promise.resolve(profile); return Promise.resolve(profile);
else } else {
return scopedSession.getSessionProfile(); return scopedSession.getSessionProfile();
}
}; };