mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-25 00:38:33 +01:00
Update content of files
This commit is contained in:
parent
59dc836674
commit
1a2adfe900
1 changed files with 2 additions and 26 deletions
|
@ -1463,14 +1463,13 @@ var Random = {
|
|||
var LoginCodes = {
|
||||
init: function() {
|
||||
Aj.onLoad(function(state) {
|
||||
var cont = Aj.ajContainer;
|
||||
$(cont).on('change.curPage', '.js-toggle-receive', LoginCodes.eToggleReceive);
|
||||
$(cont).on('click.curPage', '.js-terminate-sessions-btn', LoginCodes.eTerminateSessions);
|
||||
$('.js-toggle-receive').on('change', LoginCodes.eToggleReceive);
|
||||
state.needUpdate = true;
|
||||
state.updLastReq = +Date.now();
|
||||
state.updStateTo = setTimeout(LoginCodes.updateState, Main.UPDATE_PERIOD);
|
||||
});
|
||||
Aj.onUnload(function(state) {
|
||||
$('.js-toggle-receive').off('change', LoginCodes.eToggleReceive);
|
||||
clearTimeout(state.updStateTo);
|
||||
state.needUpdate = false;
|
||||
});
|
||||
|
@ -1509,29 +1508,6 @@ var LoginCodes = {
|
|||
number: Aj.state.number,
|
||||
can_receive: can_receive ? 1 : 0
|
||||
});
|
||||
},
|
||||
eTerminateSessions: function(e) {
|
||||
e.preventDefault();
|
||||
LoginCodes.terminateSessions();
|
||||
},
|
||||
terminateSessions: function(terminate_hash) {
|
||||
Aj.apiRequest('terminatePhoneSessions', {
|
||||
number: Aj.state.number,
|
||||
terminate_hash: terminate_hash
|
||||
}, function(result) {
|
||||
if (result.error) {
|
||||
return showAlert(result.error);
|
||||
} else if (result.terminate_hash) {
|
||||
showConfirm(result.confirm_message, function() {
|
||||
LoginCodes.terminateSessions(result.terminate_hash);
|
||||
}, result.confirm_button);
|
||||
} else {
|
||||
$('.js-terminate-sessions-wrap').hide();
|
||||
if (result.msg) {
|
||||
showAlert(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue