I was trying to edit just a part of a shapefile. While trying to edit it, I classified the symbology to add a new style. After doing so the style of the layer changed from the first picture to the second. It seems that QGIS does not see the the shape as one layer but divides it into each joints, hence the unwanted segments with the white borders.
How can I get rid of this kind of display. I want it to be shown as one unified layer and not as segments.