fix(desktop): Fixed issue where some links on desktop would not correctly open in the browser
This commit is contained in:
@@ -7,7 +7,7 @@ import PreferencesMenuItem from './PreferencesComponents/MenuItem'
|
|||||||
import { PreferencesMenu } from './PreferencesMenu'
|
import { PreferencesMenu } from './PreferencesMenu'
|
||||||
import { PreferenceId } from '@standardnotes/ui-services'
|
import { PreferenceId } from '@standardnotes/ui-services'
|
||||||
import { useApplication } from '../ApplicationProvider'
|
import { useApplication } from '../ApplicationProvider'
|
||||||
import { classNames } from '@standardnotes/snjs'
|
import { classNames, Environment } from '@standardnotes/snjs'
|
||||||
import { isIOS } from '@/Utils'
|
import { isIOS } from '@/Utils'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -49,6 +49,9 @@ const PreferencesMenuView: FunctionComponent<Props> = ({ menu }) => {
|
|||||||
if (application.isNativeMobileWeb()) {
|
if (application.isNativeMobileWeb()) {
|
||||||
application.mobileDevice().openUrl(link)
|
application.mobileDevice().openUrl(link)
|
||||||
return
|
return
|
||||||
|
} else if (application.environment === Environment.Desktop) {
|
||||||
|
application.desktopDevice?.openUrl(link)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
window.open(link, '_blank')
|
window.open(link, '_blank')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { WebApplication } from '@/Application/Application'
|
import { WebApplication } from '@/Application/Application'
|
||||||
import { isDesktopApplication } from '@/Utils'
|
import { isDesktopApplication } from '@/Utils'
|
||||||
|
import { Environment } from '@standardnotes/snjs'
|
||||||
import { RouteType } from '@standardnotes/ui-services'
|
import { RouteType } from '@standardnotes/ui-services'
|
||||||
|
|
||||||
export const getPurchaseFlowUrl = async (application: WebApplication): Promise<string | undefined> => {
|
export const getPurchaseFlowUrl = async (application: WebApplication): Promise<string | undefined> => {
|
||||||
@@ -30,6 +31,8 @@ export const loadPurchaseFlowUrl = async (application: WebApplication): Promise<
|
|||||||
|
|
||||||
if (application.isNativeMobileWeb()) {
|
if (application.isNativeMobileWeb()) {
|
||||||
application.mobileDevice().openUrl(finalUrl)
|
application.mobileDevice().openUrl(finalUrl)
|
||||||
|
} else if (application.environment === Environment.Desktop) {
|
||||||
|
application.desktopDevice?.openUrl(finalUrl)
|
||||||
} else {
|
} else {
|
||||||
const windowProxy = window.open('', '_blank')
|
const windowProxy = window.open('', '_blank')
|
||||||
;(windowProxy as WindowProxy).location = finalUrl
|
;(windowProxy as WindowProxy).location = finalUrl
|
||||||
|
|||||||
Reference in New Issue
Block a user