fix(desktop): Fixed issue where some links on desktop would not correctly open in the browser

This commit is contained in:
Aman Harwara
2023-02-07 12:36:37 +05:30
parent 7ad9eab4d8
commit f0d49f6b21
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import { WebApplication } from '@/Application/Application'
import { isDesktopApplication } from '@/Utils'
import { Environment } from '@standardnotes/snjs'
import { RouteType } from '@standardnotes/ui-services'
export const getPurchaseFlowUrl = async (application: WebApplication): Promise<string | undefined> => {
@@ -30,6 +31,8 @@ export const loadPurchaseFlowUrl = async (application: WebApplication): Promise<
if (application.isNativeMobileWeb()) {
application.mobileDevice().openUrl(finalUrl)
} else if (application.environment === Environment.Desktop) {
application.desktopDevice?.openUrl(finalUrl)
} else {
const windowProxy = window.open('', '_blank')
;(windowProxy as WindowProxy).location = finalUrl