|
@@ -12,6 +12,7 @@ import { sendMB } from '@/infrastructure/event-tracking'
|
|
|
|
|
|
|
|
import LeaveProjectModal from './leave-project-modal'
|
|
import LeaveProjectModal from './leave-project-modal'
|
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
|
|
|
+import { useLocation } from '@/shared/hooks/use-location'
|
|
|
|
|
|
|
|
function SharingUpdatesRoot() {
|
|
function SharingUpdatesRoot() {
|
|
|
const [showModal, setShowModal] = useState(false)
|
|
const [showModal, setShowModal] = useState(false)
|
|
@@ -20,6 +21,7 @@ function SharingUpdatesRoot() {
|
|
|
const { isLoading, isSuccess, isError, runAsync } = useAsync()
|
|
const { isLoading, isSuccess, isError, runAsync } = useAsync()
|
|
|
const projectId = getMeta('ol-project_id')
|
|
const projectId = getMeta('ol-project_id')
|
|
|
|
|
|
|
|
|
|
+ const location = useLocation()
|
|
|
const joinProject = useCallback(() => {
|
|
const joinProject = useCallback(() => {
|
|
|
sendMB('notification-click', {
|
|
sendMB('notification-click', {
|
|
|
name: 'link-sharing-collaborator',
|
|
name: 'link-sharing-collaborator',
|
|
@@ -30,7 +32,7 @@ function SharingUpdatesRoot() {
|
|
|
location.assign(`/project/${projectId}`)
|
|
location.assign(`/project/${projectId}`)
|
|
|
})
|
|
})
|
|
|
.catch(debugConsole.error)
|
|
.catch(debugConsole.error)
|
|
|
- }, [runAsync, projectId])
|
|
|
|
|
|
|
+ }, [runAsync, projectId, location])
|
|
|
|
|
|
|
|
const viewProject = useCallback(() => {
|
|
const viewProject = useCallback(() => {
|
|
|
sendMB('notification-click', {
|
|
sendMB('notification-click', {
|
|
@@ -42,7 +44,7 @@ function SharingUpdatesRoot() {
|
|
|
location.assign(`/project/${projectId}`)
|
|
location.assign(`/project/${projectId}`)
|
|
|
})
|
|
})
|
|
|
.catch(debugConsole.error)
|
|
.catch(debugConsole.error)
|
|
|
- }, [runAsync, projectId])
|
|
|
|
|
|
|
+ }, [runAsync, projectId, location])
|
|
|
|
|
|
|
|
const leaveProject = useCallback(() => {
|
|
const leaveProject = useCallback(() => {
|
|
|
sendMB('notification-click', {
|
|
sendMB('notification-click', {
|
|
@@ -54,7 +56,7 @@ function SharingUpdatesRoot() {
|
|
|
location.assign('/project')
|
|
location.assign('/project')
|
|
|
})
|
|
})
|
|
|
.catch(debugConsole.error)
|
|
.catch(debugConsole.error)
|
|
|
- }, [runAsync, projectId])
|
|
|
|
|
|
|
+ }, [runAsync, projectId, location])
|
|
|
|
|
|
|
|
if (!isReady) {
|
|
if (!isReady) {
|
|
|
return null
|
|
return null
|