Skip to content

Commit 010d210

Browse files
committed
feat(dotcms): Add dotUVE subscription for real-time updates in app.js
1 parent a5d7a88 commit 010d210

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

  • examples
    • dotcms-laravel/resources/js
    • dotcms-symfony/assets
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
import './bootstrap';
2+
3+
// dotUVE is a global variable that is set by the dotCMS UVE JavaScript API
4+
if (window.dotUVE) {
5+
window.dotUVE.createUVESubscription('changes', (changes) => {
6+
window.location.reload();
7+
})
8+
} else {
9+
console.warn('dotUVE is not available, you might experience issues with the the Universal Visual Editor');
10+
}

examples/dotcms-symfony/assets/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ import './bootstrap.js';
88
import './styles/app.css';
99

1010
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');
11+
12+
// dotUVE is a global variable that is set by the dotCMS UVE JavaScript API
13+
if (window.dotUVE) {
14+
window.dotUVE.createUVESubscription('changes', (changes) => {
15+
window.location.reload();
16+
})
17+
} else {
18+
console.warn('dotUVE is not available, you might experience issues with the the Universal Visual Editor');
19+
}

0 commit comments

Comments
 (0)