Skip to content

Commit

Permalink
Merge pull request #1396 from Opekunov/js-fixes
Browse files Browse the repository at this point in the history
fix: #1267 for v3
  • Loading branch information
lee-to authored Dec 19, 2024
2 parents b6902bd + a641f40 commit 26816fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/UI/resources/js/Request/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export default function request(
return
}

if (!navigator.onLine) {
t.loading = false
MoonShine.ui.toast('No internet connection', 'error')
return
}

if (!(componentRequestData instanceof ComponentRequestData)) {
componentRequestData = new ComponentRequestData()
}
Expand Down Expand Up @@ -102,11 +108,11 @@ export default function request(
componentRequestData.events,
t,
)

return
}

if (!errorResponse?.response?.data) {
MoonShine.ui.toast('Unknown Error', 'error')
return
}

Expand Down

0 comments on commit 26816fe

Please sign in to comment.