This feature has already been requested before, you can refer to the discussion here - we need click and drag on the eye icon to switch the visable status of the layer.
There is also a plugin which helps with this - ShapesAndLayers Plugin [8 tools](Krita 5+)