mirror of
https://github.com/foss42/apidash.git
synced 2025-12-05 12:34:26 +08:00
fix: disable onChanged for read-only auth fields
This commit is contained in:
@@ -61,14 +61,16 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
||||
],
|
||||
tooltip: "Select where to add JWT token",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newAddTokenTo) {
|
||||
if (newAddTokenTo != null) {
|
||||
setState(() {
|
||||
_addTokenTo = newAddTokenTo;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newAddTokenTo) {
|
||||
if (newAddTokenTo != null) {
|
||||
setState(() {
|
||||
_addTokenTo = newAddTokenTo;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
@@ -99,14 +101,16 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
||||
],
|
||||
tooltip: "Select JWT algorithm",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newAlgorithm) {
|
||||
if (newAlgorithm != null) {
|
||||
setState(() {
|
||||
_algorithm = newAlgorithm;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newAlgorithm) {
|
||||
if (newAlgorithm != null) {
|
||||
setState(() {
|
||||
_algorithm = newAlgorithm;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (_algorithm.startsWith('HS')) ...[
|
||||
|
||||
Reference in New Issue
Block a user