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 { PreferenceId } from '@standardnotes/ui-services'
|
||||
import { useApplication } from '../ApplicationProvider'
|
||||
import { classNames } from '@standardnotes/snjs'
|
||||
import { classNames, Environment } from '@standardnotes/snjs'
|
||||
import { isIOS } from '@/Utils'
|
||||
|
||||
type Props = {
|
||||
@@ -49,6 +49,9 @@ const PreferencesMenuView: FunctionComponent<Props> = ({ menu }) => {
|
||||
if (application.isNativeMobileWeb()) {
|
||||
application.mobileDevice().openUrl(link)
|
||||
return
|
||||
} else if (application.environment === Environment.Desktop) {
|
||||
application.desktopDevice?.openUrl(link)
|
||||
return
|
||||
}
|
||||
|
||||
window.open(link, '_blank')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user