Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions resources/js/components/Graphql.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
type: String,
},
check: {
type: String,
type: Function,
},
redirect: {
type: String,
Expand Down Expand Up @@ -80,7 +80,7 @@ export default {
: await magentoGraphQL(this.query, this.variables, options)

if (this.check) {
if (!eval('response?.data?.' + this.check)) {
if (!this.check(response?.data)) {
Turbo.visit(window.url(this.redirect))
return false
}
Expand Down
3 changes: 1 addition & 2 deletions resources/js/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ import useMask from './stores/useMask'
import { swatches, clear as clearSwatches } from './stores/useSwatches'
import { clear as clearAttributes } from './stores/useAttributes.js'
import './vue'
import { computed } from 'vue'
import './fetch'
import './filters'
import './mixins'
import './turbolinks'
import './cookies'
import './callbacks'
import './vue-components'
;(() => import('./turbolinks'))()

function init() {
// https://vuejs.org/api/application.html#app-config-performance
Expand Down
2 changes: 1 addition & 1 deletion resources/js/turbolinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import * as Turbo from '@hotwired/turbo'
import TurbolinksAdapter from 'vue-turbolinks'
Vue.use(TurbolinksAdapter)

Turbo.setProgressBarDelay(5)
Turbo.config.drive.progressBarDelay = 5
Loading