@@ -24,6 +24,7 @@ import { ApplicationTheme } from '../lib/application-theme'
2424import { TitleBarStyle } from '../lib/title-bar-style'
2525import { OkCancelButtonGroup } from '../dialog/ok-cancel-button-group'
2626import { Integrations } from './integrations'
27+ import { BranchSortOrder } from '../../models/branch-sort-order'
2728import {
2829 UncommittedChangesStrategy ,
2930 defaultUncommittedChangesStrategy ,
@@ -95,6 +96,7 @@ interface IPreferencesProps {
9596 readonly showWorktrees : boolean
9697 readonly repositoryIndicatorsEnabled : boolean
9798 readonly showBranchNameInRepoList : ShowBranchNameInRepoListSetting
99+ readonly branchSortOrder : BranchSortOrder
98100 readonly hideWindowOnQuit : boolean
99101 readonly onEditGlobalGitConfig : ( ) => void
100102 readonly underlineLinks : boolean
@@ -147,6 +149,7 @@ interface IPreferencesState {
147149 readonly existingLockFilePath ?: string
148150 readonly repositoryIndicatorsEnabled : boolean
149151 readonly showBranchNameInRepoList : ShowBranchNameInRepoListSetting
152+ readonly branchSortOrder : BranchSortOrder
150153 readonly hideWindowOnQuit : boolean
151154
152155 readonly initiallySelectedTheme : ApplicationTheme
@@ -223,6 +226,7 @@ export class Preferences extends React.Component<
223226 showWorktrees : this . props . showWorktrees ,
224227 repositoryIndicatorsEnabled : this . props . repositoryIndicatorsEnabled ,
225228 showBranchNameInRepoList : this . props . showBranchNameInRepoList ,
229+ branchSortOrder : this . props . branchSortOrder ,
226230 hideWindowOnQuit : this . props . hideWindowOnQuit ,
227231 initiallySelectedTheme : this . props . selectedTheme ,
228232 initiallySelectedTabSize : this . props . selectedTabSize ,
@@ -560,6 +564,8 @@ export class Preferences extends React.Component<
560564 onShowBranchNameInRepoListChanged = {
561565 this . onShowBranchNameInRepoListChanged
562566 }
567+ branchSortOrder = { this . state . branchSortOrder }
568+ onBranchSortOrderChanged = { this . onBranchSortOrderChanged }
563569 />
564570 )
565571 break
@@ -811,6 +817,10 @@ export class Preferences extends React.Component<
811817 this . setState ( { showBranchNameInRepoList } )
812818 }
813819
820+ private onBranchSortOrderChanged = ( branchSortOrder : BranchSortOrder ) => {
821+ this . setState ( { branchSortOrder } )
822+ }
823+
814824 private onSelectedTabSizeChanged = ( tabSize : number ) => {
815825 this . props . dispatcher . setSelectedTabSize ( tabSize )
816826 }
@@ -1017,6 +1027,7 @@ export class Preferences extends React.Component<
10171027 dispatcher . setDiffCheckMarksSetting ( this . state . showDiffCheckMarks )
10181028
10191029 dispatcher . setShowBranchNameInRepoList ( this . state . showBranchNameInRepoList )
1030+ dispatcher . setBranchSortOrder ( this . state . branchSortOrder )
10201031
10211032 this . props . onDismissed ( )
10221033 }
0 commit comments