I came across a solution and wanted to let others find this if they ever needed. Electron has a powerMonitor api which allows you to handle this and in my case it was the below code that fixed it for me
Electron.PowerMonitor.OnShutdown += () =>
{
Log.Logger.Debug("Assist app is shutting down.., exiting app !!");
Electron.App.Exit();
};