|
|
@ -93,22 +93,27 @@ export default class AppPrivacyAndSecurityTab extends SliderSuperTab { |
|
|
|
let blockedCount: number; |
|
|
|
let blockedCount: number; |
|
|
|
const setBlockedCount = (count: number) => { |
|
|
|
const setBlockedCount = (count: number) => { |
|
|
|
blockedCount = count; |
|
|
|
blockedCount = count; |
|
|
|
blockedUsersRow.subtitle.innerText = count + ' ' + (count !== 1 ? 'users' : 'user'); |
|
|
|
blockedUsersRow.subtitle.innerText = count ? (count + ' ' + (count > 1 ? 'users' : 'user')) : 'None'; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.listenerSetter.add(rootScope, 'peer_block', (update) => { |
|
|
|
this.listenerSetter.add(rootScope, 'peer_block', () => { |
|
|
|
const {blocked, peerId} = update; |
|
|
|
/* const {blocked, peerId} = update; |
|
|
|
if(!blocked) blockedPeerIds.findAndSplice(p => p === peerId); |
|
|
|
if(!blocked) blockedPeerIds.findAndSplice(p => p === peerId); |
|
|
|
else blockedPeerIds.unshift(peerId); |
|
|
|
else blockedPeerIds.unshift(peerId); |
|
|
|
blockedCount += blocked ? 1 : -1; |
|
|
|
blockedCount += blocked ? 1 : -1; |
|
|
|
setBlockedCount(blockedCount); |
|
|
|
setBlockedCount(blockedCount); */ |
|
|
|
|
|
|
|
updateBlocked(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
appUsersManager.getBlocked().then(res => { |
|
|
|
const updateBlocked = () => { |
|
|
|
blockedUsersRow.freezed = false; |
|
|
|
appUsersManager.getBlocked().then(res => { |
|
|
|
setBlockedCount(res.count); |
|
|
|
blockedUsersRow.freezed = false; |
|
|
|
blockedPeerIds = res.peerIds; |
|
|
|
setBlockedCount(res.count); |
|
|
|
}); |
|
|
|
blockedPeerIds = res.peerIds; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateBlocked(); |
|
|
|
|
|
|
|
|
|
|
|
passwordManager.getState().then(state => { |
|
|
|
passwordManager.getState().then(state => { |
|
|
|
passwordState = state; |
|
|
|
passwordState = state; |
|
|
|