Skip to content

Commit

Permalink
feature flag it!
Browse files Browse the repository at this point in the history
  • Loading branch information
outofambit committed Jul 30, 2019
1 parent 0e22276 commit 7308e6a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions app/src/lib/feature-flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ export function enableWSLDetection(): boolean {
export function enableBranchProtectionWarningFlow(): boolean {
return enableBranchProtectionChecks() && enableDevelopmentFeatures()
}

export function enableHideWhitespaceInDiffOption(): boolean {
return enableBetaFeatures()
}
3 changes: 2 additions & 1 deletion app/src/lib/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ import {
enableStashing,
enableBranchProtectionChecks,
enableBranchProtectionWarningFlow,
enableHideWhitespaceInDiffOption,
} from '../feature-flag'
import { Banner, BannerType } from '../../models/banner'
import * as moment from 'moment'
Expand Down Expand Up @@ -1262,7 +1263,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
repository,
file,
sha,
this.hideWhitespaceInDiff
enableHideWhitespaceInDiffOption() ? this.hideWhitespaceInDiff : false
)

const stateAfterLoad = this.repositoryStateCache.get(repository)
Expand Down
22 changes: 12 additions & 10 deletions app/src/ui/history/commit-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getAvatarUsersForCommit, IAvatarUser } from '../../models/avatar'
import { AvatarStack } from '../lib/avatar-stack'
import { CommitAttribution } from '../lib/commit-attribution'
import { Checkbox, CheckboxValue } from '../lib/checkbox'
import { enableHideWhitespaceInDiffOption } from '../../lib/feature-flag'

interface ICommitSummaryProps {
readonly repository: Repository
Expand Down Expand Up @@ -351,16 +352,17 @@ export class CommitSummary extends React.Component<

{filesDescription}
</li>

<Checkbox
label="Hide Whitespace"
value={
this.props.hideWhitespaceInDiff
? CheckboxValue.On
: CheckboxValue.Off
}
onChange={this.onHideWhitespaceInDiffChanged}
/>
{enableHideWhitespaceInDiffOption() && (
<Checkbox
label="Hide Whitespace"
value={
this.props.hideWhitespaceInDiff
? CheckboxValue.On
: CheckboxValue.Off
}
onChange={this.onHideWhitespaceInDiffChanged}
/>
)}
</ul>
</div>

Expand Down

0 comments on commit 7308e6a

Please sign in to comment.