mirror of
https://github.com/foss42/apidash.git
synced 2025-12-05 20:40:02 +08:00
fix: disable onChanged for read-only auth fields
This commit is contained in:
@@ -55,7 +55,9 @@ class _ApiKeyAuthFieldsState extends State<ApiKeyAuthFields> {
|
||||
],
|
||||
tooltip: "Select where to add API key",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newLocation) {
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newLocation) {
|
||||
if (newLocation != null) {
|
||||
setState(() {
|
||||
_addKeyTo = newLocation;
|
||||
|
||||
@@ -102,7 +102,9 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
||||
],
|
||||
tooltip: "Algorithm that will be used to produce the digest",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newLocation) {
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newLocation) {
|
||||
if (newLocation != null) {
|
||||
setState(() {
|
||||
_algorithmController = newLocation;
|
||||
|
||||
@@ -61,7 +61,9 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
||||
],
|
||||
tooltip: "Select where to add JWT token",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newAddTokenTo) {
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newAddTokenTo) {
|
||||
if (newAddTokenTo != null) {
|
||||
setState(() {
|
||||
_addTokenTo = newAddTokenTo;
|
||||
@@ -99,7 +101,9 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
||||
],
|
||||
tooltip: "Select JWT algorithm",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newAlgorithm) {
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newAlgorithm) {
|
||||
if (newAlgorithm != null) {
|
||||
setState(() {
|
||||
_algorithm = newAlgorithm;
|
||||
|
||||
Reference in New Issue
Block a user