chore(version-snjs): 2.14.1
This commit is contained in:
@@ -5,10 +5,6 @@ import {
|
||||
} from '@/preferences/components';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { useCallback, useEffect, useState } from 'preact/hooks';
|
||||
import {
|
||||
GetSubscriptionResponse,
|
||||
GetSubscriptionsResponse,
|
||||
} from '@standardnotes/snjs/dist/@types/services/api/responses';
|
||||
import { SubscriptionState } from './subscription_state';
|
||||
import { SubscriptionInformation } from './SubscriptionInformation';
|
||||
import { NoSubscription } from './NoSubscription';
|
||||
@@ -31,10 +27,9 @@ export const Subscription = observer(({
|
||||
|
||||
const getSubscriptions = useCallback(async () => {
|
||||
try {
|
||||
const result = await application.getSubscriptions();
|
||||
if (result.data) {
|
||||
const data = (result as GetSubscriptionsResponse).data;
|
||||
subscriptionState.setAvailableSubscriptions(data!);
|
||||
const subscriptions = await application.getAvailableSubscriptions();
|
||||
if (subscriptions) {
|
||||
subscriptionState.setAvailableSubscriptions(subscriptions);
|
||||
}
|
||||
} catch (e) {
|
||||
// Error in this call will only prevent the plan name from showing
|
||||
@@ -43,13 +38,9 @@ export const Subscription = observer(({
|
||||
|
||||
const getSubscription = useCallback(async () => {
|
||||
try {
|
||||
const result = await application.getUserSubscription();
|
||||
if (!result.error && result.data) {
|
||||
const data = (result as GetSubscriptionResponse).data;
|
||||
const subscription = data!.subscription;
|
||||
const subscription = await application.getUserSubscription();
|
||||
if (subscription) {
|
||||
subscriptionState.setUserSubscription(subscription);
|
||||
} else {
|
||||
setError(true);
|
||||
}
|
||||
} catch (e) {
|
||||
setError(true);
|
||||
|
||||
@@ -9,6 +9,7 @@ type Props = {
|
||||
|
||||
const StatusText = observer(({ subscriptionState }: Props) => {
|
||||
const { userSubscription, userSubscriptionName } = subscriptionState;
|
||||
const expirationDate = new Date(userSubscription!.endsAt / 1000).toLocaleString();
|
||||
|
||||
return userSubscription!.cancelled ? (
|
||||
<Text>
|
||||
@@ -20,7 +21,7 @@ const StatusText = observer(({ subscriptionState }: Props) => {
|
||||
subscription has been{' '}
|
||||
<span className="font-bold">
|
||||
canceled but will remain valid until{' '}
|
||||
{new Date(userSubscription!.endsAt).toLocaleString()}
|
||||
{expirationDate}
|
||||
</span>
|
||||
. You may resubscribe below if you wish.
|
||||
</Text>
|
||||
@@ -33,7 +34,7 @@ const StatusText = observer(({ subscriptionState }: Props) => {
|
||||
</span>{' '}
|
||||
subscription will be{' '}
|
||||
<span className="font-bold">
|
||||
renewed on {new Date(userSubscription!.endsAt).toLocaleString()}
|
||||
renewed on {expirationDate}
|
||||
</span>
|
||||
.
|
||||
</Text>
|
||||
|
||||
@@ -25,6 +25,7 @@ import { NativeExtManager } from '@/services/nativeExtManager';
|
||||
import { StatusManager } from '@/services/statusManager';
|
||||
import { ThemeManager } from '@/services/themeManager';
|
||||
import { AppVersion } from '@/version';
|
||||
import { isDev } from '@/utils';
|
||||
|
||||
type WebServices = {
|
||||
appState: AppState;
|
||||
@@ -64,7 +65,8 @@ export class WebApplication extends SNApplication {
|
||||
identifier,
|
||||
[],
|
||||
defaultSyncServerHost,
|
||||
AppVersion
|
||||
AppVersion,
|
||||
isDev,
|
||||
);
|
||||
this.$compile = $compile;
|
||||
this.scope = scope;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"@reach/dialog": "^0.13.0",
|
||||
"@standardnotes/sncrypto-web": "1.5.2",
|
||||
"@standardnotes/features": "1.6.1",
|
||||
"@standardnotes/snjs": "2.12.3",
|
||||
"@standardnotes/snjs": "2.14.1",
|
||||
"mobx": "^6.3.2",
|
||||
"mobx-react-lite": "^3.2.0",
|
||||
"preact": "^10.5.12",
|
||||
|
||||
49
yarn.lock
49
yarn.lock
@@ -2011,34 +2011,29 @@
|
||||
prop-types "^15.7.2"
|
||||
tslib "^2.1.0"
|
||||
|
||||
"@standardnotes/auth@3.1.1":
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.1.1.tgz#834701c2e14d31eb204bff90457fa05e9183464a"
|
||||
integrity sha512-E9zDYZ1gJkVZBEzd7a1L2haQ4GYeH1lUrY87UmDH1AMYUHW+c0SqZ71af1fBNqGzrx3EZSXk+Qzr7RyOa6N1Mw==
|
||||
|
||||
"@standardnotes/auth@^3.2.0":
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.7.0.tgz#1193f0521bd3b1c3655685c27aff894b98c7f582"
|
||||
integrity sha512-lHMRyVOxF9g11MH04wcbhpErPysL721Hgrzbi6slRDqIuA+2VpECIkbAhI5WpgP5K8RjO/kZB4l0tzcRI1Mg/g==
|
||||
"@standardnotes/auth@3.7.1", "@standardnotes/auth@^3.7.0":
|
||||
version "3.7.1"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.7.1.tgz#d0b1eb63f605e04ecb077fdb5ef83e3fe6db33f9"
|
||||
integrity sha512-xtjAvtikLW3Xv75X/kYA1KTm8FJVPPlXvl+ofnrf/ijkIaRkbUW/3TUhMES+G5CMiG2TZv6uVn32GqJipqgQQQ==
|
||||
dependencies:
|
||||
"@standardnotes/common" "^1.0.0"
|
||||
"@standardnotes/common" "^1.1.0"
|
||||
|
||||
"@standardnotes/common@1.1.0", "@standardnotes/common@^1.0.0", "@standardnotes/common@^1.1.0":
|
||||
"@standardnotes/common@1.1.0", "@standardnotes/common@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/common/-/common-1.1.0.tgz#5ffb0a50f9947471e236bb66d097f153ad9a148f"
|
||||
integrity sha512-Nm2IFWbMSfZDD7cnKtN+Gjic0f+PhPq/da/o4eOoUKg21VeOaQkTn+jlQKraKIs6Lmf+w9mmPNAgMc5o4hj7Lg==
|
||||
|
||||
"@standardnotes/domain-events@2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/domain-events/-/domain-events-2.0.0.tgz#6e537485054c6b32cb1d9408fab9cd132ed0fb65"
|
||||
integrity sha512-4rMCGw2Gy1CLfi6SkpsH7QzbT/80g5gVGeicEHhHvLhMolAEsHXCGOjpw5/nA3YKl8B/U8s6wvaee2vIDejFLA==
|
||||
"@standardnotes/domain-events@2.1.0":
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/domain-events/-/domain-events-2.1.0.tgz#a5c4379983a728a738f145aa9e76f7640c7283a2"
|
||||
integrity sha512-8bCQk2V2fyWKalVWC9L8cuj2kuKLe+bTTp0xBVTDpDhWrGFzXfsI79AzWbOl/CLHJU/PWrXf1lvUgQwPwT+RlA==
|
||||
dependencies:
|
||||
"@standardnotes/auth" "^3.2.0"
|
||||
"@standardnotes/auth" "^3.7.0"
|
||||
|
||||
"@standardnotes/features@1.6.0":
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.6.0.tgz#91317255bbad376670fd81fa445abc2d14fd43d9"
|
||||
integrity sha512-0gN1UKpX0LZxOk7HlnLxbl7N8Drvyw36zRErFn3pSetUNQpr92Pd6qTTNNflBBtY2pwzqoP4XVB/2kZRJFAo8w==
|
||||
"@standardnotes/features@1.6.2":
|
||||
version "1.6.2"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.6.2.tgz#98c5998426d9f93e06c2846c5bc7b6aef8d31063"
|
||||
integrity sha512-s/rqRyG7mrrgxJOzckPSYlB68wsRpM9jlFwDE+7zQO5/xKh+37ueWfy3RoqOgkKLey6lMpnTurofIJCvqLM3dQ==
|
||||
dependencies:
|
||||
"@standardnotes/common" "^1.1.0"
|
||||
|
||||
@@ -2067,15 +2062,15 @@
|
||||
"@standardnotes/sncrypto-common" "^1.5.2"
|
||||
libsodium-wrappers "^0.7.8"
|
||||
|
||||
"@standardnotes/snjs@2.12.1":
|
||||
version "2.12.1"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.12.1.tgz#4c2cac0e9f87d55d7d24a30f0fbe90d878869c7b"
|
||||
integrity sha512-4ehV9Nviko0yLs8NUToSXQvOTcQs4XlU2e1sfSkvZZ+Z+iQZo/gR/Xc9gXhr/PvJpahecJIAnbcLpPlJ/DU9MQ==
|
||||
"@standardnotes/snjs@2.14.1":
|
||||
version "2.14.1"
|
||||
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.14.1.tgz#cafd401fc32370919ccb94a2566d5318bb8805ee"
|
||||
integrity sha512-iaKtF99LlmCfKRz8F6BnMrEeHSwmSyFmawMotcJkTc2vH66167xfF+VoijuB9YLzjbgjJpI5KXDlrPzZE/+PxQ==
|
||||
dependencies:
|
||||
"@standardnotes/auth" "3.1.1"
|
||||
"@standardnotes/auth" "3.7.1"
|
||||
"@standardnotes/common" "1.1.0"
|
||||
"@standardnotes/domain-events" "2.0.0"
|
||||
"@standardnotes/features" "1.6.0"
|
||||
"@standardnotes/domain-events" "2.1.0"
|
||||
"@standardnotes/features" "1.6.2"
|
||||
"@standardnotes/settings" "1.2.0"
|
||||
"@standardnotes/sncrypto-common" "1.5.2"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user