File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 8484 data [ 'database' ] = data . organization_id
8585 }
8686
87+ let response
8788 if ( isBrowser && indexeddb && data [ 'storage' ] . includes ( 'indexeddb' ) ) {
88- let response = await indexeddb . send ( data )
89+ response = await indexeddb . send ( data )
8990
9091 let type = data . method . split ( '.' ) [ 0 ] ;
9192 if ( data . status !== 'await' && type && response && response [ type ] && response [ type ] . length ) {
9495 response . resolved = true
9596
9697 this . socket . send ( response )
97- } else {
98- this . socket . send ( response || data ) . then ( ( response ) => {
99- resolve ( response ) ;
100- } )
10198 }
102- } else {
103- this . socket . send ( data ) . then ( ( response ) => {
99+ }
100+
101+ if ( ! response || response . status !== 'resolve' ) {
102+ this . socket . send ( response || data ) . then ( ( response ) => {
104103 resolve ( response ) ;
105104 } )
105+
106106 }
107107 } )
108108 } ,
173173 }
174174
175175 response = await indexeddb . send ( response )
176-
177- if ( ! response [ type ] . length || ! response [ type ] [ 0 ] . organization_id ) {
176+ if ( ! response [ type ] . length || type === 'object' && response [ type ] [ 0 ] && response [ type ] [ 0 ] . _id && Object . keys ( response [ type ] [ 0 ] ) . length === 1 ) {
178177 response . method = type + '.create'
179178 response [ type ] = data [ type ] [ i ]
180179 response = await indexeddb . send ( response )
You can’t perform that action at this time.
0 commit comments