Skip to content

Commit 237110a

Browse files
committed
fix: avoid using nullish coalescing assignment
1 parent 8b67a2b commit 237110a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default defineNuxtPlugin((nuxtApp) => {
4747

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

50-
token.value ??= reqOpts?.token?.value
50+
if (!token.value) { token.value = reqOpts?.token?.value }
5151

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

67-
if (token.value === undefined) { token.value ??= v?.token?.value }
67+
if (token.value === undefined) { token.value = v?.token?.value }
6868

6969
if (token.value) {
7070
token.value = token.value.trim()

0 commit comments

Comments
 (0)