|  |  | @ -4,6 +4,7 @@ import { Avatar } from '../Avatar'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import { PropsData as ConversationListItemPropsType } from '../ConversationListItem'; |  |  |  | import { PropsData as ConversationListItemPropsType } from '../ConversationListItem'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import { MultiDeviceProtocol } from '../../session/protocols'; |  |  |  | import { MultiDeviceProtocol } from '../../session/protocols'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import { UserUtil } from '../../util'; |  |  |  | import { UserUtil } from '../../util'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import { createOrUpdateItem, getItemById } from '../../../js/modules/data'; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | export enum SectionType { |  |  |  | export enum SectionType { | 
			
		
	
		
		
			
				
					
					|  |  |  |   Profile, |  |  |  |   Profile, | 
			
		
	
	
		
		
			
				
					|  |  | @ -59,18 +60,33 @@ export class ActionsPanel extends React.Component<Props, State> { | 
			
		
	
		
		
			
				
					
					|  |  |  |           'refreshAvatarCallback' |  |  |  |           'refreshAvatarCallback' | 
			
		
	
		
		
			
				
					
					|  |  |  |         ); |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  |         setTimeout(async () => { |  |  |  |         setTimeout(async () => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const disabledMultiDeviceCountDb = await getItemById( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             'disabledMultiDeviceCount' | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const disabledMultiDeviceCount = | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             Number(disabledMultiDeviceCountDb?.value) || 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const data = { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             id: 'disabledMultiDeviceCount', | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             value: String(disabledMultiDeviceCount + 1), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           }; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           await createOrUpdateItem(data); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           if (disabledMultiDeviceCount % 5 !== 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |           const currentDevice = await UserUtil.getCurrentDevicePubKey(); |  |  |  |           const currentDevice = await UserUtil.getCurrentDevicePubKey(); | 
			
		
	
		
		
			
				
					
					|  |  |  |           if (!currentDevice) { |  |  |  |           if (!currentDevice) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return; |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |           const secondaryDevices = await MultiDeviceProtocol.getSecondaryDevices(currentDevice); |  |  |  |           const secondaryDevices = await MultiDeviceProtocol.getSecondaryDevices( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           const isSecondary = secondaryDevices.find(s => s.key === currentDevice) || !!window.textsecure.storage.get('isSecondaryDevice'); |  |  |  |             currentDevice | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const isSecondary = | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             secondaryDevices.find(s => s.key === currentDevice) || | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             !!window.textsecure.storage.get('isSecondaryDevice'); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           const hasMultipleDevices = |  |  |  |           const hasMultipleDevices = | 
			
		
	
		
		
			
				
					
					|  |  |  |             (await MultiDeviceProtocol.getOurDevices()).length > 1; |  |  |  |             (await MultiDeviceProtocol.getOurDevices()).length > 1; | 
			
		
	
		
		
			
				
					
					|  |  |  |           const primaryWithSecondary = |  |  |  |           const primaryWithSecondary = !isSecondary && hasMultipleDevices; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             !isSecondary && |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             hasMultipleDevices; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           if (!primaryWithSecondary && !isSecondary) { |  |  |  |           if (!primaryWithSecondary && !isSecondary) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return; |  |  |  |             return; | 
			
		
	
	
		
		
			
				
					|  |  | 
 |