|
|
|
@ -37,6 +37,7 @@ export interface Props {
|
|
|
|
|
verified: boolean;
|
|
|
|
|
profileName?: string;
|
|
|
|
|
avatarPath?: string;
|
|
|
|
|
isSecondaryDevice?: boolean;
|
|
|
|
|
|
|
|
|
|
i18n: LocalizerType;
|
|
|
|
|
updateSearchTerm: (searchTerm: string) => void;
|
|
|
|
@ -98,7 +99,10 @@ export class MainHeader extends React.Component<Props, any> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public componentDidUpdate(_prevProps: Props, prevState: any) {
|
|
|
|
|
if (prevState.hasPass !== this.state.hasPass) {
|
|
|
|
|
if (
|
|
|
|
|
prevState.hasPass !== this.state.hasPass ||
|
|
|
|
|
_prevProps.isSecondaryDevice !== this.props.isSecondaryDevice
|
|
|
|
|
) {
|
|
|
|
|
this.updateMenuItems();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -304,7 +308,7 @@ export class MainHeader extends React.Component<Props, any> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private updateMenuItems() {
|
|
|
|
|
const { i18n, onCopyPublicKey } = this.props;
|
|
|
|
|
const { i18n, onCopyPublicKey, isSecondaryDevice } = this.props;
|
|
|
|
|
const { hasPass } = this.state;
|
|
|
|
|
|
|
|
|
|
const menuItems = [
|
|
|
|
@ -351,6 +355,16 @@ export class MainHeader extends React.Component<Props, any> {
|
|
|
|
|
menuItems.push(passItem('set'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isSecondaryDevice) {
|
|
|
|
|
menuItems.push({
|
|
|
|
|
id: 'pairNewDevice',
|
|
|
|
|
name: 'Pair new Device',
|
|
|
|
|
onClick: () => {
|
|
|
|
|
trigger('showDevicePairingDialog');
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({ menuItems });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|