Skip to content

Commit

Permalink
fix: avoid using nullish coalescing assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Diizzayy committed Nov 16, 2022
1 parent 8b67a2b commit 237110a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default defineNuxtPlugin((nuxtApp) => {

const reqOpts = defu(nuxtApp._gqlState.value?.[name]?.options || {}, { headers: {} })

token.value ??= reqOpts?.token?.value
if (!token.value) { token.value = reqOpts?.token?.value }

if (token.value === undefined && typeof v.tokenStorage === 'object') {
if (v.tokenStorage?.mode === 'cookie') {
Expand All @@ -64,7 +64,7 @@ export default defineNuxtPlugin((nuxtApp) => {
}
}

if (token.value === undefined) { token.value ??= v?.token?.value }
if (token.value === undefined) { token.value = v?.token?.value }

if (token.value) {
token.value = token.value.trim()
Expand Down

0 comments on commit 237110a

Please sign in to comment.