When i call this function logout(true)
in my back end electron code the dialog box shows before the renderer has finished loading the new page is there anyway i can make this code run in the correct order where the page loads then the error message is sent?
function logout(authFail) {
win.loadFile(path.join(__dirname, 'src','login.html'));
currentusername = null
currentpassword = null
if (authFail == true) {
dialog.showErrorBox("Error","Unauthorised Access!")
}
}