Heat the oil in a large, deep heavy-based pan over medium heat, add the mustard seeds, and stir-fry for 1 minute, or until they start to splutter.
Add the urad dal and stir-fry for about 1 minute, or until lightly golden, then add the onion and stir-fry for about 2 minutes, or until translucent and glossy. Add the ginger and chillies and stir-fry for a few seconds, before adding the curry leaves.
Stir, then add the potatoes and stir-fry for about 5 minutes, or until the potatoes are half cooked.
Now add the spinach and coconut and season with salt. Cover with a lid and cook for 3 minutes or until the spinach has wilted.
Remove the cover and stir-fry for 3-5 minutes, or until all the moisture has evaporated and the potatoes are soft. Remove from the heat and adjust the seasoning, if necessary.