Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/aants/src/components/WhatChangedBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Section, Text } from '@react-email/components';

import { BLUE } from '../theme';

import { StatusPill } from './StatusPill';

export interface StatusChange {
Expand Down
8 changes: 4 additions & 4 deletions apps/antalmanac/src/actions/ActionTypesStore.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { EventEmitter } from 'events';

import type { CustomEventId, RepeatingCustomEvent, ScheduleCourse } from '@packages/antalmanac-types';

import { autoSaveSchedule } from '$actions/AppStoreActions';
import trpc from '$lib/api/trpc';
import { getLocalStorageAutoSave } from '$lib/localStorage';
import AppStore from '$stores/AppStore';
import { scheduleComponentsToggleStore } from '$stores/ScheduleComponentsToggleStore';
import { useSessionStore } from '$stores/SessionStore';
import type { CustomEventId, RepeatingCustomEvent, ScheduleCourse } from '@packages/antalmanac-types';

export interface UndoRedoAction {
type: 'undoRedoAction';
Expand Down Expand Up @@ -123,11 +122,12 @@ class ActionTypesStore extends EventEmitter {
}

if (autoSave) {
const { users, accounts } = await trpc.userData.getUserAndAccountBySessionToken.query({
const result = await trpc.userData.getUserAndAccountBySessionToken.query({
token: sessionStore.session,
});

if (accounts.providerAccountId) {
if (result && result.accounts.providerAccountId) {
const { users, accounts } = result;
this.emit('autoSaveStart');
await autoSaveSchedule(accounts.providerAccountId, { userInfo: users });
AppStore.unsavedChanges = false;
Expand Down
1 change: 1 addition & 0 deletions apps/antalmanac/src/actions/AppStoreActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ const handleScheduleImport = async (username: string, skipImportedCheck = false)
const userAndAccount = await trpc.userData.getUserAndAccountBySessionToken.query({
token: session.session ?? '',
});
if (!userAndAccount) return { imported: false, error: 'Session not found' };
const { users, accounts } = userAndAccount;

const incomingData: User | null = await trpc.userData.getUserData.query({ userId: incomingUser.id });
Expand Down
5 changes: 2 additions & 3 deletions apps/antalmanac/src/app/Theme.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
'use client';

import { BLUE, DARK_PAPER_BG, LIGHT_BLUE } from '$src/globals';
import { useThemeStore } from '$stores/SettingsStore';
import { CssBaseline, type PaletteOptions } from '@mui/material';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Roboto } from 'next/font/google';
import { usePostHog } from 'posthog-js/react';
import { useEffect, useMemo } from 'react';

import { BLUE, DARK_PAPER_BG, LIGHT_BLUE } from '$src/globals';
import { useThemeStore } from '$stores/SettingsStore';

const roboto = Roboto({
weight: ['300', '400', '500', '700'],
subsets: ['latin'],
Expand Down
1 change: 1 addition & 0 deletions apps/antalmanac/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Metadata, Viewport } from 'next';
import Script from 'next/script';

import './globals.css';

const ANTALMANAC_DESCRIPTION = 'A schedule planning and course exploration tool for UCI students.';
Expand Down
Loading
Loading