@@ -5,8 +5,6 @@ import { CourierProvider } from "@trycourier/react-provider";
5
5
import { Inbox } from "@trycourier/react-inbox" ;
6
6
7
7
import mockMiddleware from "./mock-middleware" ;
8
- import { Authentication } from "../getting-started/index.stories" ;
9
-
10
8
const API_URL = process . env . API_URL || "" ;
11
9
const INBOX_API_URL = process . env . INBOX_API_URL || "" ;
12
10
const CLIENT_KEY = process . env . CLIENT_KEY || "" ;
@@ -142,7 +140,9 @@ export const Version2 = () => {
142
140
}} />\n\`\`\`` } </ ReactMarkdown >
143
141
</ div >
144
142
< CourierProvider
145
- middleware = { [ mockMiddleware ] }
143
+ applyMiddleware = { ( defaultMiddleware ) => {
144
+ return [ mockMiddleware , ...defaultMiddleware ] ;
145
+ } }
146
146
wsOptions = { {
147
147
url : process . env . WS_URL ,
148
148
} }
@@ -175,7 +175,8 @@ export const Loading = () => {
175
175
}} />\n\`\`\`` } </ ReactMarkdown >
176
176
</ div >
177
177
< CourierProvider
178
- middleware = { [
178
+ applyMiddleware = { ( defaultMiddleware ) => [
179
+ ...defaultMiddleware ,
179
180
( ) => ( next ) => ( action ) => {
180
181
if ( action . type === "inbox/INIT" ) {
181
182
next ( {
@@ -228,7 +229,8 @@ export const LoadingMore = () => {
228
229
}} />\n\`\`\`` } </ ReactMarkdown >
229
230
</ div >
230
231
< CourierProvider
231
- middleware = { [
232
+ applyMiddleware = { ( defaultMiddleware ) => [
233
+ ...defaultMiddleware ,
232
234
( ) => ( next ) => ( action ) => {
233
235
if ( action . type === "inbox/INIT" ) {
234
236
next ( {
@@ -282,7 +284,8 @@ export const PaginationEnd = () => {
282
284
}} />\n\`\`\`` } </ ReactMarkdown >
283
285
</ div >
284
286
< CourierProvider
285
- middleware = { [
287
+ applyMiddleware = { ( defaultMiddleware ) => [
288
+ ...defaultMiddleware ,
286
289
( ) => ( next ) => ( action ) => {
287
290
if ( action . type === "inbox/INIT" ) {
288
291
next ( {
@@ -336,7 +339,8 @@ export const NoCourierFooter = () => {
336
339
}} />\n\`\`\`` } </ ReactMarkdown >
337
340
</ div >
338
341
< CourierProvider
339
- middleware = { [
342
+ applyMiddleware = { ( defaultMiddleware ) => [
343
+ ...defaultMiddleware ,
340
344
( ) => ( next ) => ( action ) => {
341
345
if ( action . type === "inbox/INIT" ) {
342
346
next ( {
@@ -393,7 +397,8 @@ export const NoMessages = () => {
393
397
}} />\n\`\`\`` } </ ReactMarkdown >
394
398
</ div >
395
399
< CourierProvider
396
- middleware = { [
400
+ applyMiddleware = { ( defaultMiddleware ) => [
401
+ ...defaultMiddleware ,
397
402
( ) => ( next ) => ( action ) => {
398
403
if ( action . type === "inbox/INIT" ) {
399
404
next ( {
@@ -447,7 +452,8 @@ export const WithPreferences = () => {
447
452
}} />\n\`\`\`` } </ ReactMarkdown >
448
453
</ div >
449
454
< CourierProvider
450
- middleware = { [
455
+ applyMiddleware = { ( defaultMiddleware ) => [
456
+ ...defaultMiddleware ,
451
457
( ) => ( next ) => ( action ) => {
452
458
if ( action . type === "inbox/FETCH_UNREAD_MESSAGE_COUNT/DONE" ) {
453
459
next ( {
0 commit comments