Skip to content

Commit

Permalink
Fix(Account): React to 26 like 27 if testing
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Apr 28, 2024
1 parent 250257c commit 40802b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { OrderFolderResource, TLocalTree } from './interfaces/Resource'
import { Capacitor } from '@capacitor/core'
import IAccount from './interfaces/Account'
import Mappings from './Mappings'
import { isTest } from './isTest'

// register Adapters
AdapterFactory.register('nextcloud-folders', async() => (await import('./adapters/NextcloudBookmarks')).default)
Expand Down Expand Up @@ -311,7 +312,7 @@ export default class Account {
syncing: false,
scheduled: false,
})
if (matchAllErrors(e, e => e.code !== 27)) {
if (matchAllErrors(e, e => e.code !== 27 && (!isTest || e.code !== 26))) {
await this.storage.setCurrentContinuation(null)
}
this.syncing = false
Expand All @@ -321,7 +322,7 @@ export default class Account {

// reset cache and mappings after error
// (but not after interruption or NetworkError)
if (matchAllErrors(e, e => e.code !== 27 && e.code !== 17)) {
if (matchAllErrors(e, e => e.code !== 27 && e.code !== 17 && (!isTest || e.code !== 26))) {
await this.init()
}
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/isTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isTest = (new URL(window.location.href)).pathname.includes('test')

0 comments on commit 40802b9

Please sign in to comment.