mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
refactor(core): delegate credential activation (#45692)
This commit is contained in:
committed by
GitHub
Unverified
parent
02550b36c7
commit
62d9aa9838
@@ -719,16 +719,7 @@ const layer = Layer.effect(
|
||||
}),
|
||||
})
|
||||
}),
|
||||
activate: Effect.fn("Integration.connection.activate")(function* (credentialID) {
|
||||
const credential = yield* credentials.get(credentialID)
|
||||
if (!credential) return
|
||||
const active = resolveConnections(
|
||||
state.get().integrations.get(credential.integrationID),
|
||||
yield* credentials.list(credential.integrationID),
|
||||
)[0]
|
||||
if (active?.type === "credential" && active.id === credentialID) return
|
||||
yield* credentials.activate(credentialID)
|
||||
}),
|
||||
activate: Effect.fn("Integration.connection.activate")((credentialID) => credentials.activate(credentialID)),
|
||||
update: Effect.fn("Integration.connection.update")((credentialID, updates) =>
|
||||
credentials.update(credentialID, updates),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user