Revert "feat: show connected providers in /connect dialog (#8351)"
This reverts commit a57c8669b6.
This commit is contained in:
@@ -26,14 +26,11 @@ export function createDialogProviderOptions() {
|
|||||||
const sync = useSync()
|
const sync = useSync()
|
||||||
const dialog = useDialog()
|
const dialog = useDialog()
|
||||||
const sdk = useSDK()
|
const sdk = useSDK()
|
||||||
const connected = createMemo(() => new Set(sync.data.provider_next.connected))
|
|
||||||
const options = createMemo(() => {
|
const options = createMemo(() => {
|
||||||
return pipe(
|
return pipe(
|
||||||
sync.data.provider_next.all,
|
sync.data.provider_next.all,
|
||||||
sortBy((x) => PROVIDER_PRIORITY[x.id] ?? 99),
|
sortBy((x) => PROVIDER_PRIORITY[x.id] ?? 99),
|
||||||
map((provider) => {
|
map((provider) => ({
|
||||||
const isConnected = connected().has(provider.id)
|
|
||||||
return {
|
|
||||||
title: provider.name,
|
title: provider.name,
|
||||||
value: provider.id,
|
value: provider.id,
|
||||||
description: {
|
description: {
|
||||||
@@ -42,7 +39,6 @@ export function createDialogProviderOptions() {
|
|||||||
openai: "(ChatGPT Plus/Pro or API key)",
|
openai: "(ChatGPT Plus/Pro or API key)",
|
||||||
}[provider.id],
|
}[provider.id],
|
||||||
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
|
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
|
||||||
footer: isConnected ? "Connected" : undefined,
|
|
||||||
async onSelect() {
|
async onSelect() {
|
||||||
const methods = sync.data.provider_auth[provider.id] ?? [
|
const methods = sync.data.provider_auth[provider.id] ?? [
|
||||||
{
|
{
|
||||||
@@ -77,22 +73,12 @@ export function createDialogProviderOptions() {
|
|||||||
})
|
})
|
||||||
if (result.data?.method === "code") {
|
if (result.data?.method === "code") {
|
||||||
dialog.replace(() => (
|
dialog.replace(() => (
|
||||||
<CodeMethod
|
<CodeMethod providerID={provider.id} title={method.label} index={index} authorization={result.data!} />
|
||||||
providerID={provider.id}
|
|
||||||
title={method.label}
|
|
||||||
index={index}
|
|
||||||
authorization={result.data!}
|
|
||||||
/>
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
if (result.data?.method === "auto") {
|
if (result.data?.method === "auto") {
|
||||||
dialog.replace(() => (
|
dialog.replace(() => (
|
||||||
<AutoMethod
|
<AutoMethod providerID={provider.id} title={method.label} index={index} authorization={result.data!} />
|
||||||
providerID={provider.id}
|
|
||||||
title={method.label}
|
|
||||||
index={index}
|
|
||||||
authorization={result.data!}
|
|
||||||
/>
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,8 +86,7 @@ export function createDialogProviderOptions() {
|
|||||||
return dialog.replace(() => <ApiMethod providerID={provider.id} title={method.label} />)
|
return dialog.replace(() => <ApiMethod providerID={provider.id} title={method.label} />)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
})),
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
return options
|
return options
|
||||||
|
|||||||
Reference in New Issue
Block a user