This commit is contained in:
lloydzhou 2024-11-07 17:40:03 +08:00
parent c526ff80b5
commit c00ebbea4f

View File

@ -106,7 +106,6 @@ export function RealtimeChat({
} }
} catch (error) { } catch (error) {
console.error("Set message failed:", error); console.error("Set message failed:", error);
setStatus("Set message failed");
} }
} catch (error) { } catch (error) {
console.error("Connection failed:", error); console.error("Connection failed:", error);
@ -303,7 +302,7 @@ export function RealtimeChat({
icon={isRecording ? <VoiceOffIcon /> : <VoiceIcon />} icon={isRecording ? <VoiceOffIcon /> : <VoiceIcon />}
onClick={toggleRecording} onClick={toggleRecording}
disabled={!isConnected} disabled={!isConnected}
type={isRecording ? "danger" : "primary"} type={isRecording ? "danger" : isConnected ? "primary" : null}
/> />
</div> </div>
<div className={styles["icon-center"]}>{status}</div> <div className={styles["icon-center"]}>{status}</div>