123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- // @flow
-
- import {
- SET_CALENDAR_AUTHORIZATION,
- SET_CALENDAR_EVENTS,
- ADD_KNOWN_DOMAIN,
- REFRESH_CALENDAR
- } from './actionTypes';
-
- /**
- * Sends an action to add a new known domain if not present yet.
- *
- * @param {string} knownDomain - The new domain.
- * @returns {{
- * type: ADD_KNOWN_DOMAIN,
- * knownDomain: string
- * }}
- */
- export function addKnownDomain(knownDomain: string) {
- return {
- type: ADD_KNOWN_DOMAIN,
- knownDomain
- };
- }
-
- /**
- * Sends an action to refresh the entry list (fetches new data).
- *
- * @param {boolean|undefined} forcePermission - Whether to force to re-ask for
- * the permission or not.
- * @returns {{
- * type: REFRESH_CALENDAR,
- * forcePermission: boolean
- * }}
- */
- export function refreshCalendar(forcePermission: boolean = false) {
- return {
- type: REFRESH_CALENDAR,
- forcePermission
- };
- }
-
- /**
- * Sends an action to signal that a calendar access has been requested. For more
- * info, see {@link SET_CALENDAR_AUTHORIZATION}.
- *
- * @param {string | undefined} authorization - The result of the last calendar
- * authorization request.
- * @returns {{
- * type: SET_CALENDAR_AUTHORIZATION,
- * authorization: ?string
- * }}
- */
- export function setCalendarAuthorization(authorization: ?string) {
- return {
- type: SET_CALENDAR_AUTHORIZATION,
- authorization
- };
- }
-
- /**
- * Sends an action to update the current calendar list in redux.
- *
- * @param {Array<Object>} events - The new list.
- * @returns {{
- * type: SET_CALENDAR_EVENTS,
- * events: Array<Object>
- * }}
- */
- export function setCalendarEvents(events: Array<Object>) {
- return {
- type: SET_CALENDAR_EVENTS,
- events
- };
- }
|