mirror of
https://github.com/MGislv/NekoX.git
synced 2024-07-04 11:13:36 +00:00
Fix sessions
This commit is contained in:
parent
4ef352adfd
commit
3baedb37f2
|
@ -431,39 +431,39 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if (currentType == 0) {
|
||||
undoView = new UndoView(context) {
|
||||
@Override
|
||||
public void hide(boolean apply, int animated) {
|
||||
if (!apply) {
|
||||
TLRPC.TL_authorization authorization = (TLRPC.TL_authorization) getCurrentInfoObject();
|
||||
TLRPC.TL_account_resetAuthorization req = new TLRPC.TL_account_resetAuthorization();
|
||||
req.hash = authorization.hash;
|
||||
ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
||||
if (error == null) {
|
||||
sessions.remove(authorization);
|
||||
passwordSessions.remove(authorization);
|
||||
updateRows();
|
||||
if (listAdapter != null) {
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
loadSessions(true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
super.hide(apply, animated);
|
||||
}
|
||||
};
|
||||
frameLayout.addView(undoView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.LEFT, 8, 0, 8, 8));
|
||||
}
|
||||
|
||||
if (newAuthorizationToOpen != null && undoView != null) {
|
||||
AndroidUtilities.runOnUIThread(() -> undoView.showWithAction(0, UndoView.ACTION_QR_SESSION_ACCEPTED, newAuthorizationToOpen), 3000L);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (currentType == 0) {
|
||||
undoView = new UndoView(context) {
|
||||
@Override
|
||||
public void hide(boolean apply, int animated) {
|
||||
if (!apply) {
|
||||
TLRPC.TL_authorization authorization = (TLRPC.TL_authorization) getCurrentInfoObject();
|
||||
TLRPC.TL_account_resetAuthorization req = new TLRPC.TL_account_resetAuthorization();
|
||||
req.hash = authorization.hash;
|
||||
ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
||||
if (error == null) {
|
||||
sessions.remove(authorization);
|
||||
passwordSessions.remove(authorization);
|
||||
updateRows();
|
||||
if (listAdapter != null) {
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
loadSessions(true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
super.hide(apply, animated);
|
||||
}
|
||||
};
|
||||
frameLayout.addView(undoView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.LEFT, 8, 0, 8, 8));
|
||||
}
|
||||
|
||||
if (newAuthorizationToOpen != null && undoView != null) {
|
||||
AndroidUtilities.runOnUIThread(() -> undoView.showWithAction(0, UndoView.ACTION_QR_SESSION_ACCEPTED, newAuthorizationToOpen), 3000L);
|
||||
}
|
||||
|
||||
return fragmentView;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user