25 lines
650 B
JavaScript
25 lines
650 B
JavaScript
import CalendarView from './calendar.js';
|
|
import ServerManager from './serverManager.js';
|
|
import AuthManager from './auth.js';
|
|
|
|
let authManagerRef = null;
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
const calendarView = new CalendarView({
|
|
onUnauthorized: () => authManagerRef && authManagerRef.logout()
|
|
});
|
|
calendarView.init();
|
|
|
|
const serverManager = new ServerManager();
|
|
serverManager.init();
|
|
|
|
authManagerRef = new AuthManager(calendarView, serverManager);
|
|
authManagerRef.init();
|
|
|
|
serverManager.onChange((server) => {
|
|
authManagerRef.handleServerSelection(server);
|
|
});
|
|
|
|
authManagerRef.checkExistingSession();
|
|
});
|