fix(qq): clarify QR binding states and setup actions (#6340)
* fix(qq): clarify QR binding states and setup actions * fix(qq): confirm rebinding instead of showing a persistent warning * fix(qq): make rebind credential warning conditional * docs(qq): align rebind guide with conditional warning
This commit is contained in:
1 parent
51a0fc83a2
commit
130f4edefe
27 files changed
+634
-168
No files matched your search
@@ -5,7 +5,7 @@ import type { ChannelConnectPayload } from "@/lib/types";
|
||||
import { StatePicker, type ComponentExample } from "./example";
|
||||
import { useGalleryTranslation } from "./i18n";
|
||||
|
||||
const connectStates = ["idle", "starting", "pending", "succeeded", "expired", "failed", "cancelled", "error"] as const;
|
||||
const connectStates = ["idle", "starting", "pending", "retrying", "succeeded", "expired", "failed", "cancelled", "error"] as const;
|
||||
type ConnectState = typeof connectStates[number];
|
||||
|
||||
function QQConnectionPreview() {
|
||||
@@ -13,7 +13,8 @@ function QQConnectionPreview() {
|
||||
const [state, setState] = useState<ConnectState>("pending");
|
||||
const connect: ChannelConnectPayload | null = state === "idle" || state === "starting" || state === "error"
|
||||
? null
|
||||
: { session_id: "gallery-qq", status: state, qr_url: "https://example.invalid/qq-authorization" };
|
||||
: { session_id: "gallery-qq", status: state === "retrying" ? "pending" : state,
|
||||
retrying: state === "retrying", qr_url: "https://example.invalid/qq-authorization" };
|
||||
return <>
|
||||
<StatePicker label={t("previews.channelConnect.state", { channel: "QQ" })} value={state} options={connectStates} onChange={setState} />
|
||||
<QQConnectFlowView connect={connect} busy={state === "starting"} autoStart={state === "starting"}
|
||||
|
||||
Reference in new issue
Block a user