File tree Expand file tree Collapse file tree 5 files changed +37
-27
lines changed Expand file tree Collapse file tree 5 files changed +37
-27
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const AssistantProvider = ({ children }) => {
2222 const client = useClient ( )
2323 const [ assistantState , setAssistantState ] = useState ( {
2424 message : { } ,
25- status : 'idle ' ,
25+ status : 'pending ' ,
2626 messagesId : [ ]
2727 } )
2828
@@ -82,7 +82,7 @@ const AssistantProvider = ({ children }) => {
8282 ( ) =>
8383 setAssistantState ( {
8484 message : { } ,
85- status : 'idle ' ,
85+ status : 'pending ' ,
8686 messagesId : [ ]
8787 } ) ,
8888 [ ]
Original file line number Diff line number Diff line change @@ -2,13 +2,16 @@ import React from 'react'
22
33import SearchBar from './Search/SearchBar'
44import SearchProvider from './Search/SearchProvider'
5+ import AssistantProvider from './AssistantProvider'
56
67const AssistantWrapperDesktop = ( ) => {
78 return (
89 < div className = "app-list-wrapper u-mb-3 u-mh-auto u-w-100" >
9- < SearchProvider >
10- < SearchBar />
11- </ SearchProvider >
10+ < AssistantProvider >
11+ < SearchProvider >
12+ < SearchBar />
13+ </ SearchProvider >
14+ </ AssistantProvider >
1215 </ div >
1316 )
1417}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'
66
77import Conversation from '../Conversations/Conversation'
88import ConversationBar from '../Conversations/ConversationBar'
9- import { useAssistant } from '../AssistantProvider'
9+ import AssistantProvider , { useAssistant } from '../AssistantProvider'
1010
1111const AssistantDialog = ( ) => {
1212 const { assistantState } = useAssistant ( )
@@ -36,4 +36,12 @@ const AssistantDialog = () => {
3636 )
3737}
3838
39- export default AssistantDialog
39+ const AssistantDialogWithProviders = ( ) => {
40+ return (
41+ < AssistantProvider >
42+ < AssistantDialog />
43+ </ AssistantProvider >
44+ )
45+ }
46+
47+ export default AssistantDialogWithProviders
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import flag from 'cozy-flags'
55import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
66
77import SearchProvider from '../Search/SearchProvider'
8- import { useAssistant } from '../AssistantProvider'
8+ import AssistantProvider , { useAssistant } from '../AssistantProvider'
99import { makeConversationId } from '../helpers'
1010import ResultMenuContent from '../ResultMenu/ResultMenuContent'
1111import { useSearch } from '../Search/SearchProvider'
@@ -54,9 +54,11 @@ const SearchDialog = () => {
5454
5555const SearchDialogWithProviders = ( ) => {
5656 return (
57- < SearchProvider >
58- < SearchDialog />
59- </ SearchProvider >
57+ < AssistantProvider >
58+ < SearchProvider >
59+ < SearchDialog />
60+ </ SearchProvider >
61+ </ AssistantProvider >
6062 )
6163}
6264
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import { useWallpaperContext } from 'hooks/useWallpaperContext'
2121
2222import schema from '../schema'
2323import { ConditionalWrapper } from './ConditionalWrapper'
24- import AssistantProvider from 'assistant/AssistantProvider'
2524import { WallPaperProvider } from 'hooks/useWallpaperContext'
2625import { SectionsProvider } from './Sections/SectionsContext'
2726const dictRequire = lang => require ( `locales/${ lang } .json` )
@@ -116,22 +115,20 @@ const AppWrapper = ({ children }) => {
116115 < CozyTheme >
117116 < ThemeProvider >
118117 < AlertProvider >
119- < AssistantProvider >
120- < ReduxProvider store = { store } >
121- < ConditionalWrapper
122- condition = { persistor }
123- wrapper = { children => (
124- < PersistGate loading = { null } persistor = { persistor } >
125- { children }
126- </ PersistGate >
127- ) }
128- >
129- < Inner lang = { lang } context = { context } >
118+ < ReduxProvider store = { store } >
119+ < ConditionalWrapper
120+ condition = { persistor }
121+ wrapper = { children => (
122+ < PersistGate loading = { null } persistor = { persistor } >
130123 { children }
131- </ Inner >
132- </ ConditionalWrapper >
133- </ ReduxProvider >
134- </ AssistantProvider >
124+ </ PersistGate >
125+ ) }
126+ >
127+ < Inner lang = { lang } context = { context } >
128+ { children }
129+ </ Inner >
130+ </ ConditionalWrapper >
131+ </ ReduxProvider >
135132 </ AlertProvider >
136133 </ ThemeProvider >
137134 </ CozyTheme >
You can’t perform that action at this time.
0 commit comments