chore: remove calling payments server for subscriptions if using third party api hosts (#2398)
This commit is contained in:
@@ -17,7 +17,7 @@ type Props = {
|
||||
}
|
||||
|
||||
const AccountPreferences = ({ application }: Props) => {
|
||||
const isUsingThirdPartyServer = application.isThirdPartyHostUsed()
|
||||
const isUsingThirdPartyServer = !application.sessions.isSignedIntoFirstPartyServer()
|
||||
|
||||
return (
|
||||
<PreferencesPane>
|
||||
|
||||
@@ -25,7 +25,7 @@ const FilesSection: FunctionComponent<Props> = ({ application }) => {
|
||||
setFilesQuotaUsed(parseFloat(filesQuotaUsed))
|
||||
}
|
||||
|
||||
if (!application.isThirdPartyHostUsed()) {
|
||||
if (application.sessions.isSignedIntoFirstPartyServer()) {
|
||||
const filesQuotaTotal = await application.settings.getSubscriptionSetting(
|
||||
SettingName.create(SettingName.NAMES.FileUploadBytesLimit).getValue(),
|
||||
)
|
||||
@@ -54,7 +54,12 @@ const FilesSection: FunctionComponent<Props> = ({ application }) => {
|
||||
<>
|
||||
<div className="mb-1 mt-1">
|
||||
<span className="font-semibold">{formatSizeToReadableString(filesQuotaUsed)}</span> of{' '}
|
||||
<span>{application.isThirdPartyHostUsed() ? '∞' : formatSizeToReadableString(filesQuotaTotal)}</span> used
|
||||
<span>
|
||||
{application.sessions.isSignedIntoFirstPartyServer()
|
||||
? formatSizeToReadableString(filesQuotaTotal)
|
||||
: '∞'}
|
||||
</span>{' '}
|
||||
used
|
||||
</div>
|
||||
<progress
|
||||
className="progress-bar w-full"
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
}
|
||||
|
||||
const Backups: FunctionComponent<Props> = ({ application }) => {
|
||||
const isUsingThirdPartyServer = application.isThirdPartyHostUsed()
|
||||
const isUsingThirdPartyServer = !application.sessions.isSignedIntoFirstPartyServer()
|
||||
|
||||
return (
|
||||
<PreferencesPane>
|
||||
|
||||
@@ -26,7 +26,9 @@ const OfflineSubscription: FunctionComponent<Props> = ({ application, onSuccess
|
||||
}, [application])
|
||||
|
||||
const shouldShowOfflineSubscription = () => {
|
||||
return !application.hasAccount() || application.isThirdPartyHostUsed() || hasUserPreviouslyStoredCode
|
||||
return (
|
||||
!application.hasAccount() || !application.sessions.isSignedIntoFirstPartyServer() || hasUserPreviouslyStoredCode
|
||||
)
|
||||
}
|
||||
|
||||
const handleSubscriptionCodeSubmit = async (event: React.FormEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user