pipermerriam/ethereum-function-signature-registry

UX: no user feedback when adding existing signature

ligi opened this issue · 2 comments

ligi commented

currently when you add an existing signature you press the submit button and nothing happens. This is confusing to users. Better would be SnackBar like thing similar to the success case - just with the extra info (already existed) instead of "Added"

This would be the place to start if someone wants to work on this

def post(self, *args, **kwargs):
serializer = self.get_serializer(data=self.request.data)
if not serializer.is_valid():
return Response({'serializer': serializer})
signature = serializer.save()
messages.success(
self.request._request,
"Added signature '{0}' for function '{1}'".format(
signature.bytes_signature.get_hex_display(),
signature.text_signature,
),
)
return redirect('signature-list')

a5net commented

I am rewriting this part now, so I will keep in mind this issue.