fixed PR code

This commit is contained in:
dranik
2026-05-12 12:02:13 +03:00
parent bf4bf9972d
commit e226fadb07
2 changed files with 9 additions and 7 deletions
@@ -12,10 +12,6 @@ import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import kotlin.math.max
/**
* iOS-style pairing scan chrome: dim outside a central square + white corner brackets.
* Hole layout matches iOS `layoutScanOverlayGeometry` ([pairingIosStyleHoleRectF]).
*/
class PairingQrScanOverlayView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
@@ -27,12 +23,11 @@ class PairingQrScanOverlayView @JvmOverloads constructor(
isFocusable = false
}
/** Let taps reach [PreviewView] below for tap-to-focus. */
@Suppress("ClickableViewAccessibility")
override fun onTouchEvent(event: MotionEvent): Boolean = false
private val dimPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
color = 0x8C000000.toInt() // ~55% black, same role as QML dimAlpha 0.55
color = 0x8C000000.toInt()
style = Paint.Style.FILL
}
+8 -1
View File
@@ -214,6 +214,13 @@ func handleGenerateQR(w http.ResponseWriter, r *http.Request) {
mu.Lock()
cleanupExpiredSessions(time.Now())
if _, exists := sessions[req.QRUUID]; exists {
mu.Unlock()
writeJSON(w, http.StatusConflict, map[string]string{
"message": "Conflict: QR session with this UUID already exists.",
})
return
}
sessions[req.QRUUID] = session
mu.Unlock()
@@ -271,7 +278,7 @@ func handleScanQR(w http.ResponseWriter, r *http.Request) {
// Keep compatibility with current gateway behavior: key problems are mapped to 403.
if req.AuthData.APIKey == "invalid" {
writeJSON(w, http.StatusForbidden, map[string]string{
"detail": "Forbidden: Invalid API key or unauthorized request.",
"message": "Forbidden: Invalid API key or unauthorized request.",
})
return
}