@afeefa/vue-app 0.0.146 → 0.0.147

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.
@@ -1 +1 @@
1
- 0.0.146
1
+ 0.0.147
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.146",
3
+ "version": "0.0.147",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -52,6 +52,8 @@ export class ApiAction extends ApiResourcesApiAction {
52
52
  }
53
53
 
54
54
  async beforeBulkRequest () {
55
+ this._startTime = Date.now()
56
+
55
57
  if (this._dispatchGlobalLoadingEvents) {
56
58
  eventBus.dispatch(new LoadingEvent(LoadingEvent.START_LOADING))
57
59
  }
@@ -80,6 +82,14 @@ export class ApiAction extends ApiResourcesApiAction {
80
82
  }
81
83
 
82
84
  async afterBulkRequest () {
85
+ if (this._minDuration) {
86
+ const diffTime = Date.now() - this._startTime
87
+ const restTime = Math.max(0, this._minDuration - diffTime)
88
+ if (restTime) {
89
+ await sleep(restTime / 1000)
90
+ }
91
+ }
92
+
83
93
  if (this._dispatchGlobalLoadingEvents) {
84
94
  eventBus.dispatch(new LoadingEvent(LoadingEvent.STOP_LOADING))
85
95
  }