Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/composables/useConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ interface StateResponse {

const STORAGE_KEY = 'npmx-connector'
const DEFAULT_PORT = 31415
const CONNECT_TIMEOUT_MS = 30000

export const useConnector = createSharedComposable(function useConnector() {
const { settings } = useSettings()
Expand Down Expand Up @@ -115,7 +116,7 @@ export const useConnector = createSharedComposable(function useConnector() {
const response = await $fetch<ConnectResponse>(`http://127.0.0.1:${port}/connect`, {
method: 'POST',
body: { token },
timeout: 5000,
timeout: CONNECT_TIMEOUT_MS,
})
Comment on lines 116 to 120

if (response.success && response.data) {
Expand Down Expand Up @@ -180,7 +181,7 @@ export const useConnector = createSharedComposable(function useConnector() {
headers: {
Authorization: `Bearer ${config.value.token}`,
},
timeout: 5000,
timeout: CONNECT_TIMEOUT_MS,
})

if (response.success && response.data) {
Expand Down
Loading