mockaton 8.20.3 → 8.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mockaton",
3
3
  "description": "HTTP Mock Server",
4
4
  "type": "module",
5
- "version": "8.20.3",
5
+ "version": "8.20.4",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
8
8
  "license": "MIT",
package/src/Api.js CHANGED
@@ -60,7 +60,7 @@ function serveDashboard(_, response) {
60
60
  }
61
61
 
62
62
  function serveDashboardAsset(f) {
63
- return (req, response) =>
63
+ return (_, response) =>
64
64
  sendFile(response, join(import.meta.dirname, f))
65
65
  }
66
66
 
package/src/Dashboard.js CHANGED
@@ -597,8 +597,8 @@ async function previewMock(method, urlMask, href) {
597
597
  previewMock.controller?.abort()
598
598
  previewMock.controller = new AbortController
599
599
 
600
- renderProgressBar()
601
600
  payloadViewerTitleRef.current.replaceChildren(r('span', null, Strings.fetching))
601
+ payloadViewerRef.current.replaceChildren(PayloadViewerProgressBar())
602
602
 
603
603
  try {
604
604
  const response = await fetch(href, {
@@ -607,10 +607,9 @@ async function previewMock(method, urlMask, href) {
607
607
  })
608
608
  await updatePayloadViewer(method, urlMask, response)
609
609
  }
610
- catch {}
611
-
612
- function renderProgressBar() {
613
- payloadViewerRef.current.replaceChildren(PayloadViewerProgressBar())
610
+ catch (err) {
611
+ onError(err)
612
+ payloadViewerRef.current.replaceChildren()
614
613
  }
615
614
  }
616
615
 
@@ -755,7 +754,9 @@ async function poll() {
755
754
  /** # Utils */
756
755
 
757
756
  function className(...args) {
758
- return { className: args.filter(Boolean).join(' ') }
757
+ return {
758
+ className: args.filter(Boolean).join(' ')
759
+ }
759
760
  }
760
761
 
761
762
 
@@ -3,7 +3,7 @@ import { listFilesRecursively } from './utils/fs.js'
3
3
  import { config, isFileAllowed } from './config.js'
4
4
 
5
5
 
6
- export class StaticBroker {
6
+ class StaticBroker {
7
7
  constructor(route) {
8
8
  this.route = route
9
9
  this.delayed = false