@taruvi/navkit 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/NavkitContext.tsx +4 -4
package/package.json
CHANGED
package/src/NavkitContext.tsx
CHANGED
|
@@ -27,11 +27,11 @@ export const NavkitProvider = ({ children, client }: NavkitProviderProps) => {
|
|
|
27
27
|
const [isUserAuthenticated, setIsUserAuthenticated] = useState<boolean>(false)
|
|
28
28
|
|
|
29
29
|
const checkIfDesk = async () => {
|
|
30
|
-
const fetchedSettings = await settings
|
|
31
|
-
const frontendUrl = fetchedSettings?.frontendUrl
|
|
30
|
+
const fetchedSettings = await settings?.current?.get?.()
|
|
31
|
+
const frontendUrl = fetchedSettings?.data?.frontendUrl
|
|
32
32
|
// const frontendUrl = "http://localhost:5173/desk"
|
|
33
33
|
if (!frontendUrl) return false
|
|
34
|
-
return window.location.href.includes(frontendUrl)
|
|
34
|
+
return window.location.href.includes(frontendUrl || '')
|
|
35
35
|
}
|
|
36
36
|
const navigateToUrl = (url: string, openInLine: boolean) => {
|
|
37
37
|
if (isDesk && openInLine) {
|
|
@@ -89,7 +89,7 @@ export const NavkitProvider = ({ children, client }: NavkitProviderProps) => {
|
|
|
89
89
|
// }
|
|
90
90
|
siteSettings.current = fetchedSettings
|
|
91
91
|
if (isUserAuthenticated) {
|
|
92
|
-
const userDataResponse = await user.current.getUserData()
|
|
92
|
+
const userDataResponse = await user.current.getUserData?.()
|
|
93
93
|
setUserData(userDataResponse?.data || null)
|
|
94
94
|
|
|
95
95
|
// Fetch user apps using username from userData
|