()
| 104 | } |
| 105 | |
| 106 | export async function getGeneralPortalUrl(): Promise<string | undefined> { |
| 107 | const portalUrl = await getStorageItem('portalUrl'); |
| 108 | if (portalUrl === undefined || portalUrl === '') { |
| 109 | return undefined; |
| 110 | } |
| 111 | try { |
| 112 | new URL(portalUrl); |
| 113 | } catch (error) { |
| 114 | console.log('Invalid portal URL:', portalUrl); |
| 115 | return undefined; |
| 116 | } |
| 117 | return portalUrl; |
| 118 | } |
| 119 | |
| 120 | // Note that this gets you the profile URL given the current portal URL, not the |
| 121 | // specific profile URL of the logged in account. |
no test coverage detected