maps-block-apple
maps-block-apple copied to clipboard
Entering incorrect credentials causes block to get stuck on the credential entering view
Describe the bug If you enter incorrect credentials in the block and save them, if you then correct them and save the block will not switch over to the map view. The credentials do save, so a current workaround is to refresh the screen.
Steps to Reproduce
- Enter incorrect credentials that pass the validation (10 characters for team and key IDs, with the header/footer text for the private key).
- Save and see that it remains on the credential form, which is expected.
- Change the credentials to be valid.
- Save and see that it still remains on the credential form, which is not expected.
- Refresh and see that the map view now works, indicating that your credentials were saved even though nothing happened.
Expected behavior I would expect it to switch to the map after entering correct credentials :)
Additional context
This is in the console: [MapKit] mapkit.init(): already initialized; ignoring.
. In brief discussions, it seems we need to approach this by destroying the mapkit object and then re-initializing.
Punting this to the next release so we can wrap things up on version 1.0.1 and get this release out alongside WordPress 5.5 and the Block Directory.
Spent some time trying to reinitialize or destroy the object, but wasn't able to find much help regarding this in the documentation. Played around a bit too, but this doesn't seem straightforward enough to destroy.
Also noticed the check on the configuration settings page requires a page refresh for re-checking the authorization. There seems to be some optimization that can be done around the callbacks, but I would suggest we direct the user to the configuration settings page instead, as a temp solution till we can figure this out.