mirror of
https://github.com/standardnotes/app
synced 2026-10-19 09:03:16 -04:00
chore: temporarily disallow android purchases (#3019)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { Result, SyncUseCaseInterface } from '@standardnotes/domain-core'
|
||||
import { Platform } from '@standardnotes/models'
|
||||
|
||||
export class IsAndroid implements SyncUseCaseInterface<boolean> {
|
||||
constructor(private platform: Platform) {}
|
||||
|
||||
execute(): Result<boolean> {
|
||||
return Result.ok(this.platform === Platform.Android)
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Result, SyncUseCaseInterface } from '@standardnotes/domain-core'
|
||||
import { Environment, Platform } from '@standardnotes/models'
|
||||
|
||||
export class IsNativeAndroid implements SyncUseCaseInterface<boolean> {
|
||||
constructor(
|
||||
private environment: Environment,
|
||||
private platform: Platform,
|
||||
) {}
|
||||
|
||||
execute(): Result<boolean> {
|
||||
return Result.ok(this.environment === Environment.Mobile && this.platform === Platform.Android)
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export * from './UseCase/IsGlobalSpellcheckEnabled'
|
||||
export * from './UseCase/IsNativeMobileWeb'
|
||||
export * from './UseCase/IsMobileDevice'
|
||||
export * from './UseCase/IsNativeIOS'
|
||||
export * from './UseCase/IsNativeAndroid'
|
||||
export * from './UseCase/IsAndroid'
|
||||
export * from './UseCase/GetItemTags'
|
||||
|
||||
export * from './Theme/ThemeManager'
|
||||
|
||||
@@ -48,7 +48,7 @@ export const Web_TYPES = {
|
||||
IsGlobalSpellcheckEnabled: Symbol.for('IsGlobalSpellcheckEnabled'),
|
||||
IsMobileDevice: Symbol.for('IsMobileDevice'),
|
||||
IsNativeIOS: Symbol.for('IsNativeIOS'),
|
||||
IsNativeAndroid: Symbol.for('IsNativeAndroid'),
|
||||
IsAndroid: Symbol.for('IsAndroid'),
|
||||
IsNativeMobileWeb: Symbol.for('IsNativeMobileWeb'),
|
||||
IsTabletOrMobileScreen: Symbol.for('IsTabletOrMobileScreen'),
|
||||
LoadPurchaseFlowUrl: Symbol.for('LoadPurchaseFlowUrl'),
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
IsGlobalSpellcheckEnabled,
|
||||
IsMobileDevice,
|
||||
IsNativeIOS,
|
||||
IsNativeAndroid,
|
||||
IsAndroid,
|
||||
IsNativeMobileWeb,
|
||||
KeyboardService,
|
||||
PluginsService,
|
||||
@@ -78,8 +78,8 @@ export class WebDependencies extends DependencyContainer {
|
||||
return new IsNativeIOS(application.environment, application.platform)
|
||||
})
|
||||
|
||||
this.bind(Web_TYPES.IsNativeAndroid, () => {
|
||||
return new IsNativeAndroid(application.environment, application.platform)
|
||||
this.bind(Web_TYPES.IsAndroid, () => {
|
||||
return new IsAndroid(application.platform)
|
||||
})
|
||||
|
||||
this.bind(Web_TYPES.OpenSubscriptionDashboard, () => {
|
||||
@@ -336,7 +336,7 @@ export class WebDependencies extends DependencyContainer {
|
||||
application.mobileDevice,
|
||||
this.get<LoadPurchaseFlowUrl>(Web_TYPES.LoadPurchaseFlowUrl),
|
||||
this.get<IsNativeIOS>(Web_TYPES.IsNativeIOS),
|
||||
this.get<IsNativeAndroid>(Web_TYPES.IsNativeAndroid),
|
||||
this.get<IsAndroid>(Web_TYPES.IsAndroid),
|
||||
application.events,
|
||||
)
|
||||
})
|
||||
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
IsGlobalSpellcheckEnabled,
|
||||
IsMobileDevice,
|
||||
IsNativeIOS,
|
||||
IsNativeAndroid,
|
||||
IsAndroid,
|
||||
IsNativeMobileWeb,
|
||||
KeyboardService,
|
||||
PluginsServiceInterface,
|
||||
@@ -258,12 +258,12 @@ export class WebApplication extends SNApplication implements WebApplicationInter
|
||||
return this.deps.get<IsNativeIOS>(Web_TYPES.IsNativeIOS).execute().getValue()
|
||||
}
|
||||
|
||||
isNativeAndroid(): boolean {
|
||||
return this.deps.get<IsNativeAndroid>(Web_TYPES.IsNativeAndroid).execute().getValue()
|
||||
isAndroid(): boolean {
|
||||
return this.deps.get<IsAndroid>(Web_TYPES.IsAndroid).execute().getValue()
|
||||
}
|
||||
|
||||
canShowPurchaseFlow(): boolean {
|
||||
return !this.isNativeAndroid()
|
||||
return !this.isAndroid()
|
||||
}
|
||||
|
||||
get isMobileDevice(): boolean {
|
||||
@@ -271,7 +271,7 @@ export class WebApplication extends SNApplication implements WebApplicationInter
|
||||
}
|
||||
|
||||
get hideOutboundSubscriptionLinks() {
|
||||
return this.isNativeIOS() || this.isNativeAndroid()
|
||||
return this.isNativeIOS() || this.isAndroid()
|
||||
}
|
||||
|
||||
get mobileDevice(): MobileDeviceInterface {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { action, makeObservable, observable } from 'mobx'
|
||||
import { AbstractViewController } from '../Abstract/AbstractViewController'
|
||||
import { PurchaseFlowPane } from './PurchaseFlowPane'
|
||||
import { LoadPurchaseFlowUrl } from '@/Application/UseCase/LoadPurchaseFlowUrl'
|
||||
import { IsNativeIOS, IsNativeAndroid } from '@standardnotes/ui-services'
|
||||
import { IsNativeIOS, IsAndroid } from '@standardnotes/ui-services'
|
||||
|
||||
export class PurchaseFlowController extends AbstractViewController {
|
||||
isOpen = false
|
||||
@@ -25,7 +25,7 @@ export class PurchaseFlowController extends AbstractViewController {
|
||||
private mobileDevice: MobileDeviceInterface | undefined,
|
||||
private _loadPurchaseFlowUrl: LoadPurchaseFlowUrl,
|
||||
private _isNativeIOS: IsNativeIOS,
|
||||
private _isNativeAndroid: IsNativeAndroid,
|
||||
private _isAndroid: IsAndroid,
|
||||
eventBus: InternalEventBusInterface,
|
||||
) {
|
||||
super(eventBus)
|
||||
@@ -45,7 +45,7 @@ export class PurchaseFlowController extends AbstractViewController {
|
||||
}
|
||||
|
||||
openPurchaseFlow = async (plan = AppleIAPProductId.ProPlanYearly) => {
|
||||
if (this._isNativeAndroid.execute().getValue()) {
|
||||
if (this._isAndroid.execute().getValue()) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export class PurchaseFlowController extends AbstractViewController {
|
||||
}
|
||||
|
||||
openPurchaseWebpage = async () => {
|
||||
if (this._isNativeAndroid.execute().getValue()) {
|
||||
if (this._isAndroid.execute().getValue()) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user