Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"@sanity/block-content-to-hyperscript": "^3.0.0",
"@sanity/block-content-to-markdown": "^0.0.6",
"@sanity/block-content-to-react": "^3.0.0",
"@sanity/cli": "^3.65.0",
"@sanity/cli": "^3.70.0",
"@sanity/client": "^6.21.3",
"@sanity/code-input": "^5.1.2",
"@sanity/color-input": "^4.0.2",
"@sanity/embeddings-index-ui": "^2.0.0",
"@sanity/google-maps-input": "^4.1.0",
"@sanity/icons": "^3.5.3",
"@sanity/image-url": "^1.0.2",
"@sanity/types": "^3.67.1",
"@sanity/types": "^3.70.0",
"@sanity/ui": "^2.10.11",
"@sanity/uuid": "^3.0.2",
"@sanity/vision": "^3.67.1",
"@sanity/vision": "^3.70.0",
"@sanity/webhook": "^4.0.4",
"axios": "^1.5.0",
"concurrent-queue": "^7.0.2",
Expand All @@ -73,7 +73,7 @@
"react-markdown": "^9.0.1",
"react-player": "^2.13.0",
"rxjs": "^7.8.1",
"sanity": "^3.67.1",
"sanity": "^3.70.0",
"sanity-mobile-preview": "^1.0.9",
"sanity-plugin-markdown": "^5.0.0",
"sanity-plugin-utils": "^1.6.7",
Expand Down
5 changes: 2 additions & 3 deletions plugins/desk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export const structure = (S, context) => {
// // As specified in /static/auth/login.html, we'll redirect users that contain an originPath property in localStorage
const originPath = localStorage.getItem('originPath')
if (originPath) {
localStorage.removeItem('originPath')

if (window.location.pathname !== originPath) {
// As we don't have access to router.navigateUrl without useRouter, we need to create a React component to access the latter
return S.component()
Expand All @@ -26,7 +24,8 @@ export const structure = (S, context) => {
// With this, we can finally navigateUrl to originPath
// Once in originPath, this function will run again, this time with the localStorage entry deleted, rendering the desired target.
if (router) {
router.navigateUrl(originPath)
localStorage.removeItem('originPath')
router.navigateUrl({ path: originPath, replace: true })
}
}, [router])
return null
Expand Down
Loading