Skip to content

Commit

Permalink
Merge pull request #1890 from joyceverheije/fix/console-error-on-form…
Browse files Browse the repository at this point in the history
…s-with-permissions

[3.x] Fix console error on forms with permissions
  • Loading branch information
haringsrob authored Nov 7, 2022
2 parents 42c1808 + 9d1e0a3 commit 99f4def
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views/layouts/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<script src="{{ twillAsset('main-form.js') }}" crossorigin></script>
<script>
const groupUserMapping = {!! isset($groupUserMapping) ? json_encode($groupUserMapping) : '[]' !!};
window['{{ config('twill.js_namespace ') }}'].vm.$store.subscribe((mutation, state) => {
window['{{ config('twill.js_namespace') }}'].vm.$store.subscribe((mutation, state) => {
if (mutation.type === 'updateFormField' && mutation.payload.name.endsWith('group_authorized')) {
const groupId = mutation.payload.name.replace('_group_authorized', '')
const checked = mutation.payload.value
Expand All @@ -227,7 +227,7 @@
name: `user_${userId}_permission`,
value: checked ? 'view-item' : ''
}
window['{{ config('twill.js_namespace ') }}'].vm.$store.commit('updateFormField', field)
window['{{ config('twill.js_namespace') }}'].vm.$store.commit('updateFormField', field)
}
})
}
Expand Down

0 comments on commit 99f4def

Please sign in to comment.