don't dismiss alert when about to post it again

On 4.2 and 4.3 at least, the dimiss comes after the second post
causing that to be dismissed, leaving no alert and the app in some
weird state where not even the back button works. It's been this way
on those older versions since I redid invitations for beta 98.
This commit is contained in:
Eric House 2016-07-18 09:19:09 -07:00
parent b5afc25ead
commit 5f8e5dc343

View file

@ -1570,7 +1570,7 @@ public class BoardDelegate extends DelegateBase
private void handleConndMessage( String room, int devOrder, // <- hostID
boolean allHere, int nMissing )
{
dismissInviteAlert( nMissing, true );
boolean skipDismiss = false;
int naMsg = 0;
int naKey = 0;
@ -1598,6 +1598,7 @@ public class BoardDelegate extends DelegateBase
m_room = room;
showDialog( DlgID.DLG_INVITE );
invalidateOptionsMenuIf();
skipDismiss = true;
} else {
toastStr = getQuantityString( R.plurals.msg_relay_waiting_fmt, nMissing,
devOrder, room, nMissing );
@ -1622,6 +1623,10 @@ public class BoardDelegate extends DelegateBase
}
}
if ( !skipDismiss ) {
dismissInviteAlert( nMissing, true ); // NO!!!
}
invalidateOptionsMenuIf();
} // handleConndMessage
@ -1926,26 +1931,30 @@ public class BoardDelegate extends DelegateBase
public void informMissing( boolean isServer, CommsConnTypeSet connTypes,
int nDevs, final int nMissing )
{
boolean doDismiss = true;
m_connTypes = connTypes;
Assert.assertTrue( isServer || 0 == nMissing );
// DbgUtils.logf( "BoardDelegate.informMissing(isServer=%b, nDevs=%d, nMissing=%d)",
// isServer, nDevs, nMissing );
m_nGuestDevs = nDevs;
// If we might have put up an alert earlier, take it down
dismissInviteAlert( nMissing, !m_relayMissing );
m_nMissing = nMissing; // will be 0 unless isServer is true
if ( null != connTypes && 0 == connTypes.size() ) {
askNoAddrsDelete();
} else if ( 0 < nMissing && isServer && !m_haveInvited ) {
doDismiss = false;
post( new Runnable() {
public void run() {
showDialog( DlgID.DLG_INVITE );
}
} );
}
// If we might have put up an alert earlier, take it down
if ( doDismiss ) {
dismissInviteAlert( nMissing, !m_relayMissing );
}
}
@Override