Skip to content

Commit

Permalink
[fallback]: improves
Browse files Browse the repository at this point in the history
  • Loading branch information
dfkadyr committed Apr 12, 2024
1 parent 8074fe5 commit 5a29da2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/gql-module/graphqlFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const graphqlFetch = <Data, Variables, ModifiedData>(
.replace(/[({].*/, '')
.trim()

const isUrlArrayValid = Array.isArray(url) && url.length > 1
const isUrlArrayValid = Array.isArray(url) && url.length > 0
const primaryUrl = isUrlArrayValid ? url[0] : url
const backupUrl = isUrlArrayValid ? url[1] : null
const backupUrl = isUrlArrayValid && url.length > 1 ? url[1] : null

const errorUrls = JSON.parse(sessionStorage.getItem(sessionErrorUrls) || '[]')
const validUrl = errorUrls.includes(primaryUrl) ? backupUrl : primaryUrl
Expand Down

0 comments on commit 5a29da2

Please sign in to comment.