deps(snjs): 2.20.3

This commit is contained in:
Mo Bitar
2021-12-10 11:56:00 -06:00
parent b29dc8ecc6
commit d5f75fee84
3 changed files with 121 additions and 109 deletions

View File

@@ -17,11 +17,14 @@ interface IProps {
appState: AppState;
}
export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ application, appState }) => {
export const OfflineSubscription: FunctionalComponent<IProps> = observer(
({ application, appState }) => {
const [activationCode, setActivationCode] = useState('');
const [isSuccessfullyActivated, setIsSuccessfullyActivated] = useState(false);
const [isSuccessfullyActivated, setIsSuccessfullyActivated] =
useState(false);
const [isSuccessfullyRemoved, setIsSuccessfullyRemoved] = useState(false);
const [hasUserPreviouslyStoredCode, setHasUserPreviouslyStoredCode] = useState(false);
const [hasUserPreviouslyStoredCode, setHasUserPreviouslyStoredCode] =
useState(false);
useEffect(() => {
if (application.hasOfflineRepo()) {
@@ -30,10 +33,12 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
}, [application]);
const shouldShowOfflineSubscription = () => {
return !application.hasAccount() || application.isCustomServerHostUsed();
return !application.hasAccount() || application.isThirdPartyHostUsed();
};
const handleSubscriptionCodeSubmit = async (event: TargetedEvent<HTMLFormElement, Event>) => {
const handleSubscriptionCodeSubmit = async (
event: TargetedEvent<HTMLFormElement, Event>
) => {
event.preventDefault();
const result = await application.setOfflineFeaturesCode(activationCode);
@@ -57,7 +62,8 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
};
const handleRemoveClick = async () => {
application.alertService.confirm(
application.alertService
.confirm(
STRING_REMOVE_OFFLINE_KEY_CONFIRMATION,
'Remove offline key?',
'Remove Offline Key',
@@ -80,9 +86,11 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
return (
<>
<div className='flex items-center justify-between'>
<div className='flex flex-col mt-3 w-full'>
<Subtitle>{!hasUserPreviouslyStoredCode && 'Activate'} Offline Subscription</Subtitle>
<div className="flex items-center justify-between">
<div className="flex flex-col mt-3 w-full">
<Subtitle>
{!hasUserPreviouslyStoredCode && 'Activate'} Offline Subscription
</Subtitle>
<form onSubmit={handleSubscriptionCodeSubmit}>
<div className={'mt-2'}>
{!hasUserPreviouslyStoredCode && (
@@ -97,13 +105,14 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
</div>
{(isSuccessfullyActivated || isSuccessfullyRemoved) && (
<div className={'mt-3 mb-3 info'}>
Your offline subscription code has been successfully {isSuccessfullyActivated ? 'activated' : 'removed'}.
Your offline subscription code has been successfully{' '}
{isSuccessfullyActivated ? 'activated' : 'removed'}.
</div>
)}
{hasUserPreviouslyStoredCode && (
<Button
type='danger'
label='Remove offline key'
type="danger"
label="Remove offline key"
onClick={() => {
handleRemoveClick();
}}
@@ -112,17 +121,20 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
{!hasUserPreviouslyStoredCode && !isSuccessfullyActivated && (
<Button
label={'Submit'}
type='primary'
type="primary"
disabled={activationCode === ''}
onClick={(event) =>
handleSubscriptionCodeSubmit(event as TargetedEvent<HTMLFormElement>)
handleSubscriptionCodeSubmit(
event as TargetedEvent<HTMLFormElement>
)
}
/>
)}
</form>
</div>
</div>
<HorizontalSeparator classes='mt-8 mb-5' />
<HorizontalSeparator classes="mt-8 mb-5" />
</>
);
});
}
);

View File

@@ -1,6 +1,6 @@
{
"name": "standard-notes-web",
"version": "3.9.8",
"version": "3.9.10",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
@@ -85,7 +85,7 @@
"@reach/listbox": "^0.16.2",
"@standardnotes/features": "1.10.2",
"@standardnotes/sncrypto-web": "1.5.3",
"@standardnotes/snjs": "2.20.1",
"@standardnotes/snjs": "2.20.3",
"mobx": "^6.3.5",
"mobx-react-lite": "^3.2.2",
"preact": "^10.5.15",

View File

@@ -2614,10 +2614,10 @@
buffer "^6.0.3"
libsodium-wrappers "^0.7.9"
"@standardnotes/snjs@2.20.1":
version "2.20.1"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.20.1.tgz#4813adbfd16a1c373357bd4c7ece3085abf142b4"
integrity sha512-wJILt7YerLFaZTKoIZaCkqSuvpVWoVKqCVjP0KNHrMknnbgMHZygHqrb9sr57JL1AcNCkAULEFS/kev2GYTG3Q==
"@standardnotes/snjs@2.20.3":
version "2.20.3"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.20.3.tgz#11fe962dfb017be459e856b9fbc6311c5046a0b0"
integrity sha512-FHog3p3SuMvTXsEl76UenbjY8PS6VL/b6MjaC9whJR5ZwsvmLwE0G16dWZ+z+izm+CsRaHMWU8R2cy7RG7HjZg==
dependencies:
"@standardnotes/auth" "^3.8.1"
"@standardnotes/common" "^1.2.1"