1.0.0-rc3 rc3
This commit is contained in:
@@ -668,25 +668,32 @@ function isReadonlySetting(setting) {
|
||||
function MakeMKVBetaKeyHint({ onApply, disabled = false }) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [betaKey, setBetaKey] = useState('');
|
||||
const [validUntil, setValidUntil] = useState('');
|
||||
const [error, setError] = useState('');
|
||||
const [warning, setWarning] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
let active = true;
|
||||
setLoading(true);
|
||||
setError('');
|
||||
setWarning('');
|
||||
setValidUntil('');
|
||||
|
||||
api.getMakeMKVBetaKey({ forceRefresh: true })
|
||||
api.getMakeMKVBetaKey()
|
||||
.then((response) => {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
setBetaKey(String(response?.betaKey || '').trim());
|
||||
setValidUntil(String(response?.validUntil || '').trim());
|
||||
setWarning(String(response?.warning || '').trim());
|
||||
})
|
||||
.catch((loadError) => {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
setBetaKey('');
|
||||
setValidUntil('');
|
||||
setError(loadError?.message || 'Betakey konnte nicht geladen werden.');
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -719,6 +726,12 @@ function MakeMKVBetaKeyHint({ onApply, disabled = false }) {
|
||||
{!loading && error ? (
|
||||
<small className="error-text">{error}</small>
|
||||
) : null}
|
||||
{!loading && !error && warning ? (
|
||||
<small className="setting-description">{warning}</small>
|
||||
) : null}
|
||||
{!loading && !error && validUntil ? (
|
||||
<small className="setting-description">Gültig bis: {new Date(validUntil).toLocaleString('de-DE')}</small>
|
||||
) : null}
|
||||
{!loading && !error && betaKey ? (
|
||||
<code className="makemkv-beta-key-value">{betaKey}</code>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user