You really need to supplement sodium and potassium.
When you fast, your insulin drops and signals to kidneys to excrete sodium. You also burn through your glycogen stores in the liver which has a lot of water associated. In short, you lose lot of water, and alongside it a lot of sodium and potassium.
The biggest health risk in linger fasts for obese or healthy people is actually imbalance between sodium and potassium. Both are critical for proper functioning of muscles in general. When there is an imbalance, it causes misfire in muscles. For you it is manifesting as irregular heartbeat.
Every other glass of water can have salt and no-salt. Try with various concentration till you feel better. But yoy do have to supplement electrolytes.