Remove unused state variables

This commit is contained in:
Markus Olsson 2020-07-02 15:15:30 +02:00
parent 4305612427
commit b6f3418a6f
4 changed files with 1 additions and 32 deletions

View file

@ -35,7 +35,6 @@ interface IConfigureGitUserState {
readonly name: string
readonly email: string
readonly avatarURL: string | null
/**
* If unable to save Git configuration values (name, email)
@ -67,7 +66,6 @@ export class ConfigureGitUser extends React.Component<
globalUserEmail: null,
name: '',
email: '',
avatarURL: null,
}
}
@ -132,7 +130,6 @@ export class ConfigureGitUser extends React.Component<
if (preferredEmail) {
this.setState({
email: preferredEmail.email,
avatarURL: this.avatarURLForEmail(preferredEmail.email),
})
}
}
@ -235,20 +232,7 @@ export class ConfigureGitUser extends React.Component<
}
private onEmailChange = (email: string) => {
const avatarURL = this.avatarURLForEmail(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
this.setState({ email })
}
private save = async () => {

View file

@ -61,7 +61,6 @@ interface IPreferencesState {
readonly confirmRepositoryRemoval: boolean
readonly confirmDiscardChanges: boolean
readonly confirmForcePush: boolean
readonly automaticallySwitchTheme: boolean
readonly uncommittedChangesStrategyKind: UncommittedChangesStrategyKind
readonly availableEditors: ReadonlyArray<ExternalEditor>
readonly selectedExternalEditor: ExternalEditor | null
@ -100,7 +99,6 @@ export class Preferences extends React.Component<
confirmDiscardChanges: false,
confirmForcePush: false,
uncommittedChangesStrategyKind: uncommittedChangesStrategyKindDefault,
automaticallySwitchTheme: false,
selectedExternalEditor: this.props.selectedExternalEditor,
availableShells: [],
selectedShell: this.props.selectedShell,

View file

@ -73,14 +73,6 @@ interface IRebaseFlowProps {
/** A component for initiating and performing a rebase of the current branch. */
export class RebaseFlow extends React.Component<IRebaseFlowProps> {
public constructor(props: IRebaseFlowProps) {
super(props)
this.state = {
userHasResolvedConflicts: false,
}
}
private moveToShowConflictedFileState = (step: ConfirmAbortStep) => {
const { conflictState } = step
this.props.dispatcher.setRebaseFlowStep(this.props.repository, {

View file

@ -87,7 +87,6 @@ interface IRepositoryViewProps {
}
interface IRepositoryViewState {
readonly sidebarHasFocusWithin: boolean
readonly changesListScrollTop: number
readonly compareListScrollTop: number
}
@ -108,7 +107,6 @@ export class RepositoryView extends React.Component<
super(props)
this.state = {
sidebarHasFocusWithin: false,
changesListScrollTop: 0,
compareListScrollTop: 0,
}
@ -283,9 +281,6 @@ export class RepositoryView extends React.Component<
}
private onSidebarFocusWithinChanged = (sidebarHasFocusWithin: boolean) => {
// this lets us know that focus is somewhere within the sidebar
this.setState({ sidebarHasFocusWithin })
if (
sidebarHasFocusWithin === false &&
this.props.state.selectedSection === RepositorySectionTab.History