Skip to content

Commit

Permalink
excluded out-of-office events from calender events list
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ahnaf committed Jan 12, 2025
1 parent 9a9ca28 commit 8162d81
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/generate-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const appTitle = process.env.VITE_APP_TITLE;

const manifest = {
name: appTitle,
version: '1.0.3',
version: '1.0.4',
description: appDescription,
manifest_version: 3,
key: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAstDgQFGfJrfxo3id/1KTHVZpKbsCRMKZJXDUsDT8JRfasB/CeDGmuVs1hFYBJcGgn9PbK/mnE9hzWERVFpa4sfGZ3o0lvyfPLUfJd7PmfZ/4PQvE4+GfVQPAz/p4OVtP1WtbN4DED3jmrXiSrZ72paioz/ydVOSRDfo8m3+s9K92LcraYXHItvs+rSKXgfKxflfGzByme/fVO2V4yvE6T0YOqdLDc2USF4KGx0llHvqnmtB2K+rLr3V1/UcM1b4fP6kCiZAo7K2Tngpqa8DxgLVp8GYZ7NPPFJqu4tG1G1iRjtwk8Qblqmw+jmH+qZ2WguGtFpxU7P2JD8znPu//OwIDAQAB',
Expand Down
4 changes: 4 additions & 0 deletions client/src/context/PreferencesContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export const PreferencesProvider = ({ children }: PreferencesProviderProps) => {
}, []);

useEffect(() => {
if (!preferences.title) {
preferences.title = defaultPreferences.title;
}

cacheService.save('preferences', JSON.stringify(preferences));
}, [preferences]);

Expand Down
1 change: 1 addition & 0 deletions client/src/pages/Home/MyEventsView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export default function MyEventsView() {
display: 'flex',
overflow: 'hidden',
justifyContent: 'center',
flexDirection: 'column',
}}
>
{events.length === 0 ? (
Expand Down
3 changes: 3 additions & 0 deletions server/src/google-api/google-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ export class GoogleApiService implements IGoogleApiService {
async getCalenderEvents(oauth2Client: OAuth2Client, start: string, end: string, timeZone: string, limit: number = 30): Promise<calendar_v3.Schema$Event[]> {
const calendar = google.calendar({ version: 'v3', auth: oauth2Client });

// https://developers.google.com/calendar/api/v3/reference/events/list
const eventTypes = ['workingLocation', 'default', 'fromGmail'];
const [err, result]: [GaxiosError, GaxiosResponse<calendar_v3.Schema$Events>] = await to(
calendar.events.list({
calendarId: 'primary',
timeMin: start,
timeMax: end,
timeZone,
eventTypes,
maxResults: limit,
singleEvents: true,
orderBy: 'startTime',
Expand Down

0 comments on commit 8162d81

Please sign in to comment.