That is A problem. The main problem is that at no point in time, can the shore power be connected to the inverter. You need ether a manual or automatic switch to flick between the two.
Something like this.
https://www.amazon.com/Automatic-Transfer-Controller-Change-Over-Conversion/dp/B07XZ266CY