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 }) => {
22
22
const client = useClient ( )
23
23
const [ assistantState , setAssistantState ] = useState ( {
24
24
message : { } ,
25
- status : 'idle ' ,
25
+ status : 'pending ' ,
26
26
messagesId : [ ]
27
27
} )
28
28
@@ -82,7 +82,7 @@ const AssistantProvider = ({ children }) => {
82
82
( ) =>
83
83
setAssistantState ( {
84
84
message : { } ,
85
- status : 'idle ' ,
85
+ status : 'pending ' ,
86
86
messagesId : [ ]
87
87
} ) ,
88
88
[ ]
Original file line number Diff line number Diff line change @@ -2,13 +2,16 @@ import React from 'react'
2
2
3
3
import SearchBar from './Search/SearchBar'
4
4
import SearchProvider from './Search/SearchProvider'
5
+ import AssistantProvider from './AssistantProvider'
5
6
6
7
const AssistantWrapperDesktop = ( ) => {
7
8
return (
8
9
< 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 >
12
15
</ div >
13
16
)
14
17
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'
6
6
7
7
import Conversation from '../Conversations/Conversation'
8
8
import ConversationBar from '../Conversations/ConversationBar'
9
- import { useAssistant } from '../AssistantProvider'
9
+ import AssistantProvider , { useAssistant } from '../AssistantProvider'
10
10
11
11
const AssistantDialog = ( ) => {
12
12
const { assistantState } = useAssistant ( )
@@ -36,4 +36,12 @@ const AssistantDialog = () => {
36
36
)
37
37
}
38
38
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'
5
5
import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
6
6
7
7
import SearchProvider from '../Search/SearchProvider'
8
- import { useAssistant } from '../AssistantProvider'
8
+ import AssistantProvider , { useAssistant } from '../AssistantProvider'
9
9
import { makeConversationId } from '../helpers'
10
10
import ResultMenuContent from '../ResultMenu/ResultMenuContent'
11
11
import { useSearch } from '../Search/SearchProvider'
@@ -54,9 +54,11 @@ const SearchDialog = () => {
54
54
55
55
const SearchDialogWithProviders = ( ) => {
56
56
return (
57
- < SearchProvider >
58
- < SearchDialog />
59
- </ SearchProvider >
57
+ < AssistantProvider >
58
+ < SearchProvider >
59
+ < SearchDialog />
60
+ </ SearchProvider >
61
+ </ AssistantProvider >
60
62
)
61
63
}
62
64
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import { useWallpaperContext } from 'hooks/useWallpaperContext'
21
21
22
22
import schema from '../schema'
23
23
import { ConditionalWrapper } from './ConditionalWrapper'
24
- import AssistantProvider from 'assistant/AssistantProvider'
25
24
import { WallPaperProvider } from 'hooks/useWallpaperContext'
26
25
import { SectionsProvider } from './Sections/SectionsContext'
27
26
const dictRequire = lang => require ( `locales/${ lang } .json` )
@@ -116,22 +115,20 @@ const AppWrapper = ({ children }) => {
116
115
< CozyTheme >
117
116
< ThemeProvider >
118
117
< 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 } >
130
123
{ 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 >
135
132
</ AlertProvider >
136
133
</ ThemeProvider >
137
134
</ CozyTheme >
You can’t perform that action at this time.
0 commit comments