Skip to content

Commit 93853a8

Browse files
committed
fix: useAtproto test mock fix
1 parent 9abfeac commit 93853a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/composables/atproto/useAtproto.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ declare global {
1414
var __useAtprotoMock: UseAtprotoReturn | undefined
1515
}
1616

17-
export const useAtproto = createSharedComposable(function useAtprotoImpl(): UseAtprotoReturn {
17+
function useAtprotoImpl(): UseAtprotoReturn {
1818
if (import.meta.test && globalThis.__useAtprotoMock) {
1919
return globalThis.__useAtprotoMock
2020
}
@@ -37,4 +37,8 @@ export const useAtproto = createSharedComposable(function useAtprotoImpl(): UseA
3737
}
3838

3939
return { user, pending, logout }
40-
})
40+
}
41+
42+
export const useAtproto: () => UseAtprotoReturn = import.meta.test
43+
? useAtprotoImpl
44+
: createSharedComposable(useAtprotoImpl)

0 commit comments

Comments
 (0)