This commit is contained in:
@@ -27,14 +27,14 @@ export function UpdateProvider({ children }) {
|
||||
return (
|
||||
<UpdateContext.Provider value={state}>
|
||||
{children}
|
||||
{state && (state.updateType === 'major' || state.updateType === 'minor') && (
|
||||
<ForcedUpdateModal latestVersion={state.latestVersion} />
|
||||
{state && (state.updateType === 'major' || state.updateType === 'minor' || !features.hasWindowControls) && (
|
||||
<ForcedUpdateModal updateType={state.updateType} latestVersion={state.latestVersion} />
|
||||
)}
|
||||
</UpdateContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function ForcedUpdateModal({ latestVersion }) {
|
||||
function ForcedUpdateModal({ updateType, latestVersion }) {
|
||||
const { links, updates } = usePlatform();
|
||||
const [downloading, setDownloading] = useState(false);
|
||||
const [progress, setProgress] = useState(0);
|
||||
@@ -62,12 +62,17 @@ function ForcedUpdateModal({ latestVersion }) {
|
||||
}
|
||||
};
|
||||
|
||||
const isPatch = updateType === 'patch';
|
||||
|
||||
return (
|
||||
<div className="forced-update-overlay">
|
||||
<div className="forced-update-modal">
|
||||
<h2>Update Required</h2>
|
||||
<h2>{isPatch ? 'Update Available' : 'Update Required'}</h2>
|
||||
<p>
|
||||
A new version (v{latestVersion}) is available. This update is required to continue using the app.
|
||||
{isPatch
|
||||
? `A new version (v${latestVersion}) is available.`
|
||||
: `A new version (v${latestVersion}) is available. This update is required to continue using the app.`
|
||||
}
|
||||
</p>
|
||||
{downloading ? (
|
||||
<div className="update-progress">
|
||||
|
||||
Reference in New Issue
Block a user