mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 13:40:13 +01:00
Add log in / log off in calendar
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
@@ -8,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { unhideElementById, getMyAccount } from './generalUseHelpers.js';
|
||||
function getRegisteredEvents() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const res = yield fetch("/api/events/registered");
|
||||
@@ -22,6 +22,16 @@ function getRegisteredEvents() {
|
||||
});
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
try {
|
||||
var user = yield getMyAccount();
|
||||
if (user) {
|
||||
unhideElementById(document, "logout-btn");
|
||||
}
|
||||
}
|
||||
catch (_a) {
|
||||
unhideElementById(document, "joinnow-btn");
|
||||
unhideElementById(document, "signin-btn");
|
||||
}
|
||||
const calendarEl = document.getElementById("calendar");
|
||||
if (!calendarEl)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user