It is impossible to know what happens to your eyes when you die. They may continue functioning and being active for up to four minutes after death, or the retina might be so starved of oxygen that there would be a blindness in any case.
The brain is no longer sending signals to the eye muscles, and so they stop working. This doesn’t hurt, because the nerves that carry pain messages from the eye muscles are not connected to any other nerve in the body.
In most cases, reflexes from these dead eye muscles cause discomfort for a few hours. There might be redness or swelling around them (from capillaries stretching) and sometimes stinging or burning sensations (due to fluid pooling). Our brains can’t see but our eyes can! However, after about 4 minutes after death, it just kind of goes dark.