测权限控制 释放权限 优化ws连接

This commit is contained in:
mmc
2026-08-25 11:11:29 +08:00
parent d6b5c9ad44
commit a3b2f14620
9 changed files with 97 additions and 51 deletions

View File

@@ -116,7 +116,7 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
return (
<div className="relative h-[252px] aspect-[4/3] flex items-center justify-center "
onClick={() => {
if (connected && !isControlled && hasControlRight) {
if (!isControlled) {
console.log("点击了无控制权限,发起权限请求");
// 示例:调用你代码中已有的权限请求弹窗逻辑
handleControlModal({ control: true, type: "switchPermission" });
@@ -125,7 +125,7 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
{/* Gamepad Status Badge */}
<div
className={`absolute top-0 right-0 px-2 py-0.5 rounded text-[8px] font-bold tracking-widest border
${connected || !hasControlRight
${connected
? isConnecting
? 'bg-yellow-500/20 text-yellow-400 border-yellow-500/30'
: isControlled
@@ -137,8 +137,6 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
>
{!connected ? (
t('devices.controllerNotConnected')
) : !hasControlRight ? (
t('devices.otherWebConnected')
) : isConnecting ? (
t('devices.control2')
) : isControlled ? (