Skip to content
Merged
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
11 changes: 9 additions & 2 deletions resources/js/package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.debug = import.meta.env.VITE_DEBUG == 'true'
window.Notify = (message, type = 'info', params = [], link = null) =>
setTimeout(() => window.$emit('notification-message', message, type, params, link))
setTimeout(() => window.$emit('notification-message', message, type, params, link), window.app ? 0 : 500)

if (!window.process) {
// Workaround for process missing, if data is actually needed from here you should apply the following polyfill.
Expand Down Expand Up @@ -49,11 +49,18 @@ if (import.meta.env.VITE_DEBUG === 'true') {

let booting = false
let rootEl = null
function init() {
async function init() {
if (booting || (rootEl && document.body.contains(rootEl))) {
return
}
booting = true
for (let i = 0; i < 20; i++) {
// Wait until config is available, for a max of 1s
if (window.config.store) {
break
}
await new Promise((resolve) => setTimeout(resolve, 50))
}
rootEl = document.querySelector('#app')

// Check if the localstorage needs a flush.
Expand Down
Loading