Skip to content

Commit

Permalink
Fix crash on Nova 5 / Inertia 2 (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo authored Jan 8, 2025
1 parent f288735 commit ef07c4c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
28 changes: 14 additions & 14 deletions dist/js/tool.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions resources/js/stores/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const useBrowserStore = defineStore('nova-file-manager/browser', {

const searchParams = new URLSearchParams(window.location.search)

const page = window.Nova.app.config.globalProperties.$inertia.page
const pageState = { url: `${window.location.pathname}${window.location.search}` }

for (const [key, value] of Object.entries(parameters)) {
const content = value?.toString()
Expand All @@ -417,12 +417,12 @@ const useBrowserStore = defineStore('nova-file-manager/browser', {
}
}

if (page.url !== `${window.location.pathname}?${searchParams}`) {
page.url = `${window.location.pathname}?${searchParams}`
if (pageState.url !== `${window.location.pathname}?${searchParams}`) {
pageState.url = `${window.location.pathname}?${searchParams}`

const separator = searchParams.toString().length > 0 ? '?' : ''

window.history.pushState(page, '', `${window.location.pathname}${separator}${searchParams}`)
window.history.pushState(pageState, '', `${window.location.pathname}${separator}${searchParams}`)
}
},

Expand Down Expand Up @@ -726,12 +726,12 @@ const useBrowserStore = defineStore('nova-file-manager/browser', {
let editMode

switch (this.component) {
case 'Nova.Create':
editMode = 'create'
break
case 'Nova.Update':
editMode = 'update'
break
case 'Nova.Create':
editMode = 'create'
break
case 'Nova.Update':
editMode = 'update'
break
}

data = {
Expand Down

0 comments on commit ef07c4c

Please sign in to comment.