Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritized updates #19655

Merged
merged 11 commits into from
Dec 5, 2024
Prev Previous commit
Next Next commit
Add nondismissable mode for update banner
  • Loading branch information
niik committed Dec 3, 2024
commit ae93744c58d182e16433889d887f848466c98339
1 change: 1 addition & 0 deletions app/src/ui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3130,6 +3130,7 @@ export class App extends React.Component<IAppProps, IAppState> {
isX64ToARM64ImmediateAutoUpdate={
updateStore.state.isX64ToARM64ImmediateAutoUpdate
}
prioritizeUpdate={updateStore.state.prioritizeUpdate}
onDismissed={this.onUpdateAvailableDismissed}
isUpdateShowcaseVisible={this.state.isUpdateShowcaseVisible}
emoji={this.state.emoji}
Expand Down
12 changes: 7 additions & 5 deletions app/src/ui/banners/update-available.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@ interface IUpdateAvailableProps {
readonly isUpdateShowcaseVisible: boolean
readonly emoji: Map<string, Emoji>
readonly onDismissed: () => void
readonly prioritizeUpdate: boolean
}

/**
* A component which tells the user an update is available and gives them the
* option of moving into the future or being a luddite.
*/
export class UpdateAvailable extends React.Component<
IUpdateAvailableProps,
{}
> {
export class UpdateAvailable extends React.Component<IUpdateAvailableProps> {
public render() {
return (
<Banner id="update-available" onDismissed={this.props.onDismissed}>
<Banner
id="update-available"
dismissable={!this.props.prioritizeUpdate}
onDismissed={this.props.onDismissed}
>
{!this.props.isUpdateShowcaseVisible && (
<Octicon
className="download-icon"
Expand Down
2 changes: 2 additions & 0 deletions app/src/ui/lib/update-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface IUpdateState {
lastSuccessfulCheck: Date | null
isX64ToARM64ImmediateAutoUpdate: boolean
newReleases: ReadonlyArray<ReleaseSummary> | null
prioritizeUpdate: boolean
}

/** A store which contains the current state of the auto updater. */
Expand Down Expand Up @@ -176,6 +177,7 @@ class UpdateStore {
lastSuccessfulCheck: this.lastSuccessfulCheck,
newReleases: this.newReleases,
isX64ToARM64ImmediateAutoUpdate: this.isX64ToARM64ImmediateAutoUpdate,
prioritizeUpdate: this.prioritizeUpdate,
}
}

Expand Down