chore: fix mobile device interface
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
AppleIAPProductId,
|
||||
AppleIAPReceipt,
|
||||
ApplicationIdentifier,
|
||||
ApplicationInterface,
|
||||
DatabaseKeysLoadChunkResponse,
|
||||
DatabaseLoadOptions,
|
||||
Environment,
|
||||
@@ -80,14 +79,6 @@ export class MobileDevice implements MobileDeviceInterface {
|
||||
await this.removeRawStorageValue(namespacedKey(identifier, RawStorageKey.StorageObject))
|
||||
}
|
||||
|
||||
setApplication(_application: ApplicationInterface): void {
|
||||
throw new Error('Method not implemented.')
|
||||
}
|
||||
|
||||
removeApplication(_application: ApplicationInterface): void {
|
||||
throw new Error('Method not implemented.')
|
||||
}
|
||||
|
||||
async authenticateWithU2F(authenticationOptionsJSONString: string): Promise<Record<string, unknown> | null> {
|
||||
const { Fido2ApiModule } = NativeModules
|
||||
|
||||
|
||||
@@ -156,8 +156,6 @@ const MobileWebAppContents = ({ destroyAndReload }: { destroyAndReload: () => vo
|
||||
this.messageSender = messageSender
|
||||
}
|
||||
|
||||
setApplication() {}
|
||||
|
||||
askReactNativeToInvokeInterfaceMethod(functionName, args) {
|
||||
return this.messageSender.askReactNativeToInvokeInterfaceMethod(functionName, args)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ApplicationInterface } from './../Application/ApplicationInterface'
|
||||
import { ApplicationIdentifier } from '@standardnotes/common'
|
||||
import {
|
||||
FullyFormedTransferPayload,
|
||||
@@ -34,9 +33,6 @@ export interface DeviceInterface {
|
||||
|
||||
removeRawStorageValuesForIdentifier(identifier: ApplicationIdentifier): Promise<void>
|
||||
|
||||
setApplication(application: ApplicationInterface): void
|
||||
removeApplication(application: ApplicationInterface): void
|
||||
|
||||
/**
|
||||
* On web platforms, databased created may be new.
|
||||
* New databases can be because of new sessions, or if the browser deleted it.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ApplicationInterface } from './../Application/ApplicationInterface'
|
||||
import { DeviceInterface } from './DeviceInterface'
|
||||
import { RawKeychainValue } from '@standardnotes/models'
|
||||
|
||||
@@ -7,4 +8,7 @@ export interface WebOrDesktopDeviceInterface extends DeviceInterface {
|
||||
getKeychainValue(): Promise<RawKeychainValue>
|
||||
|
||||
setKeychainValue(value: RawKeychainValue): Promise<void>
|
||||
|
||||
setApplication(application: ApplicationInterface): void
|
||||
removeApplication(application: ApplicationInterface): void
|
||||
}
|
||||
|
||||
@@ -106,7 +106,9 @@ export class WebApplication extends SNApplication implements WebApplicationInter
|
||||
dealloced: observable,
|
||||
})
|
||||
|
||||
deviceInterface.setApplication(this)
|
||||
if (!this.isNativeMobileWeb()) {
|
||||
deviceInterface.setApplication(this)
|
||||
}
|
||||
|
||||
this.itemControllerGroup = new ItemGroupController(this)
|
||||
this.routeService = new RouteService(this, this.internalEventBus)
|
||||
|
||||
@@ -15,7 +15,11 @@ export function getPlatformString() {
|
||||
try {
|
||||
const platform = navigator.platform.toLowerCase()
|
||||
let trimmed = ''
|
||||
if (platform.includes('mac')) {
|
||||
if (platform.includes('iphone')) {
|
||||
trimmed = 'ios'
|
||||
} else if (platform.includes('android')) {
|
||||
trimmed = 'android'
|
||||
} else if (platform.includes('mac')) {
|
||||
trimmed = 'mac'
|
||||
} else if (platform.includes('win')) {
|
||||
trimmed = 'windows'
|
||||
@@ -27,7 +31,7 @@ export function getPlatformString() {
|
||||
}
|
||||
return trimmed + (isDesktopApplication() ? '-desktop' : '-web')
|
||||
} catch (e) {
|
||||
return 'linux-web'
|
||||
return 'unknown-platform'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user