mirror of
https://github.com/desktop/desktop
synced 2024-08-27 12:11:00 +00:00
Remove unused state variables
This commit is contained in:
parent
4305612427
commit
b6f3418a6f
|
@ -35,7 +35,6 @@ interface IConfigureGitUserState {
|
||||||
|
|
||||||
readonly name: string
|
readonly name: string
|
||||||
readonly email: string
|
readonly email: string
|
||||||
readonly avatarURL: string | null
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If unable to save Git configuration values (name, email)
|
* If unable to save Git configuration values (name, email)
|
||||||
|
@ -67,7 +66,6 @@ export class ConfigureGitUser extends React.Component<
|
||||||
globalUserEmail: null,
|
globalUserEmail: null,
|
||||||
name: '',
|
name: '',
|
||||||
email: '',
|
email: '',
|
||||||
avatarURL: null,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +130,6 @@ export class ConfigureGitUser extends React.Component<
|
||||||
if (preferredEmail) {
|
if (preferredEmail) {
|
||||||
this.setState({
|
this.setState({
|
||||||
email: preferredEmail.email,
|
email: preferredEmail.email,
|
||||||
avatarURL: this.avatarURLForEmail(preferredEmail.email),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,20 +232,7 @@ export class ConfigureGitUser extends React.Component<
|
||||||
}
|
}
|
||||||
|
|
||||||
private onEmailChange = (email: string) => {
|
private onEmailChange = (email: string) => {
|
||||||
const avatarURL = this.avatarURLForEmail(email)
|
this.setState({ email })
|
||||||
|
|
||||||
this.setState({
|
|
||||||
name: this.state.name,
|
|
||||||
email,
|
|
||||||
avatarURL,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
private avatarURLForEmail(email: string): string | null {
|
|
||||||
const matchingAccount = this.props.accounts.find(
|
|
||||||
a => a.emails.findIndex(e => e.email === email) > -1
|
|
||||||
)
|
|
||||||
return matchingAccount ? matchingAccount.avatarURL : null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private save = async () => {
|
private save = async () => {
|
||||||
|
|
|
@ -61,7 +61,6 @@ interface IPreferencesState {
|
||||||
readonly confirmRepositoryRemoval: boolean
|
readonly confirmRepositoryRemoval: boolean
|
||||||
readonly confirmDiscardChanges: boolean
|
readonly confirmDiscardChanges: boolean
|
||||||
readonly confirmForcePush: boolean
|
readonly confirmForcePush: boolean
|
||||||
readonly automaticallySwitchTheme: boolean
|
|
||||||
readonly uncommittedChangesStrategyKind: UncommittedChangesStrategyKind
|
readonly uncommittedChangesStrategyKind: UncommittedChangesStrategyKind
|
||||||
readonly availableEditors: ReadonlyArray<ExternalEditor>
|
readonly availableEditors: ReadonlyArray<ExternalEditor>
|
||||||
readonly selectedExternalEditor: ExternalEditor | null
|
readonly selectedExternalEditor: ExternalEditor | null
|
||||||
|
@ -100,7 +99,6 @@ export class Preferences extends React.Component<
|
||||||
confirmDiscardChanges: false,
|
confirmDiscardChanges: false,
|
||||||
confirmForcePush: false,
|
confirmForcePush: false,
|
||||||
uncommittedChangesStrategyKind: uncommittedChangesStrategyKindDefault,
|
uncommittedChangesStrategyKind: uncommittedChangesStrategyKindDefault,
|
||||||
automaticallySwitchTheme: false,
|
|
||||||
selectedExternalEditor: this.props.selectedExternalEditor,
|
selectedExternalEditor: this.props.selectedExternalEditor,
|
||||||
availableShells: [],
|
availableShells: [],
|
||||||
selectedShell: this.props.selectedShell,
|
selectedShell: this.props.selectedShell,
|
||||||
|
|
|
@ -73,14 +73,6 @@ interface IRebaseFlowProps {
|
||||||
|
|
||||||
/** A component for initiating and performing a rebase of the current branch. */
|
/** A component for initiating and performing a rebase of the current branch. */
|
||||||
export class RebaseFlow extends React.Component<IRebaseFlowProps> {
|
export class RebaseFlow extends React.Component<IRebaseFlowProps> {
|
||||||
public constructor(props: IRebaseFlowProps) {
|
|
||||||
super(props)
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
userHasResolvedConflicts: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private moveToShowConflictedFileState = (step: ConfirmAbortStep) => {
|
private moveToShowConflictedFileState = (step: ConfirmAbortStep) => {
|
||||||
const { conflictState } = step
|
const { conflictState } = step
|
||||||
this.props.dispatcher.setRebaseFlowStep(this.props.repository, {
|
this.props.dispatcher.setRebaseFlowStep(this.props.repository, {
|
||||||
|
|
|
@ -87,7 +87,6 @@ interface IRepositoryViewProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IRepositoryViewState {
|
interface IRepositoryViewState {
|
||||||
readonly sidebarHasFocusWithin: boolean
|
|
||||||
readonly changesListScrollTop: number
|
readonly changesListScrollTop: number
|
||||||
readonly compareListScrollTop: number
|
readonly compareListScrollTop: number
|
||||||
}
|
}
|
||||||
|
@ -108,7 +107,6 @@ export class RepositoryView extends React.Component<
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
sidebarHasFocusWithin: false,
|
|
||||||
changesListScrollTop: 0,
|
changesListScrollTop: 0,
|
||||||
compareListScrollTop: 0,
|
compareListScrollTop: 0,
|
||||||
}
|
}
|
||||||
|
@ -283,9 +281,6 @@ export class RepositoryView extends React.Component<
|
||||||
}
|
}
|
||||||
|
|
||||||
private onSidebarFocusWithinChanged = (sidebarHasFocusWithin: boolean) => {
|
private onSidebarFocusWithinChanged = (sidebarHasFocusWithin: boolean) => {
|
||||||
// this lets us know that focus is somewhere within the sidebar
|
|
||||||
this.setState({ sidebarHasFocusWithin })
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
sidebarHasFocusWithin === false &&
|
sidebarHasFocusWithin === false &&
|
||||||
this.props.state.selectedSection === RepositorySectionTab.History
|
this.props.state.selectedSection === RepositorySectionTab.History
|
||||||
|
|
Loading…
Reference in a new issue