File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1875,9 +1875,9 @@ export class StreamChat {
1875
1875
isLatestMessageSet : true ,
1876
1876
} ,
1877
1877
} ) ;
1878
- if ( data . channels ?. length && this . offlineDb ?. upsertChannels ) {
1878
+ if ( channels ?. length && this . offlineDb ?. upsertChannels ) {
1879
1879
await this . offlineDb . upsertChannels ( {
1880
- channels : data . channels ,
1880
+ channels,
1881
1881
isLatestMessagesSet : true ,
1882
1882
} ) ;
1883
1883
}
Original file line number Diff line number Diff line change @@ -721,7 +721,7 @@ export abstract class AbstractOfflineDB implements OfflineDBApi {
721
721
} catch ( e ) {
722
722
const error = e as AxiosError < APIErrorResponse > ;
723
723
if ( error ?. response ?. data ?. code === 4 ) {
724
- // Error code 16 - message already exists
724
+ // Error code 4 - message already exists
725
725
// ignore
726
726
} else if ( error ?. response ?. data ?. code === 17 ) {
727
727
// Error code 17 - missing own_capabilities to execute the task
@@ -845,7 +845,6 @@ export class OfflineDBSyncManager {
845
845
async ( event ) => {
846
846
if ( event . online ) {
847
847
await this . syncAndExecutePendingTasks ( ) ;
848
- console . log ( 'SUBSEQUENT SYNC DONE !' ) ;
849
848
await this . invokeSyncStatusListeners ( true ) ;
850
849
} else {
851
850
await this . invokeSyncStatusListeners ( false ) ;
@@ -996,7 +995,7 @@ export class OfflineDBSyncManager {
996
995
if ( diff > 30 ) {
997
996
// stream backend will send an error if we try to sync after 30 days.
998
997
// In that case reset the entire DB and start fresh.
999
- await this . offlineDb ? .resetDB ?. ( ) ;
998
+ await this . offlineDb . resetDB ( ) ;
1000
999
} else {
1001
1000
try {
1002
1001
console . log ( 'ABOUT TO CALL SYNC API' ) ;
@@ -1009,7 +1008,6 @@ export class OfflineDBSyncManager {
1009
1008
const queries = queriesArray . flat ( ) as ExecuteBatchQueriesType ;
1010
1009
1011
1010
if ( queries . length ) {
1012
- // TODO: FIXME
1013
1011
await this . offlineDb . executeSqlBatch ( queries ) ;
1014
1012
}
1015
1013
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments