Răsfoiți Sursa

refetchEvents

Adam Shaw 7 ani în urmă
părinte
comite
61b2df09c8
2 a modificat fișierele cu 11 adăugiri și 1 ștergeri
  1. 1 1
      src/Calendar.ts
  2. 10 0
      src/reducers/event-sources.ts

+ 1 - 1
src/Calendar.ts

@@ -1079,7 +1079,7 @@ export default class Calendar {
 
 
   refetchEvents() {
-    // TODO
+    this.dispatch({ type: 'FETCH_ALL_EVENT_SOURCES' })
   }
 
 

+ 10 - 0
src/reducers/event-sources.ts

@@ -115,6 +115,16 @@ export function reduceEventSourceHash(sourceHash: EventSourceHash, action: any,
         return sourceHash
       }
 
+    case 'FETCH_ALL_EVENT_SOURCES':
+      for (let sourceId in sourceHash) {
+        calendar.dispatch({
+          type: 'FETCH_EVENT_SOURCE',
+          sourceId,
+          range: calendar.state.dateProfile.activeUnzonedRange
+        })
+      }
+      return sourceHash
+
     case 'FETCH_EVENT_SOURCE':
       eventSource = sourceHash[action.sourceId]