(message, type, throttleMs = 3000)
| 216 | } |
| 217 | |
| 218 | notifyNetworkState(message, type, throttleMs = 3000) { |
| 219 | const now = Date.now(); |
| 220 | if ( |
| 221 | this._networkToastState.type === type && |
| 222 | now - Number(this._networkToastState.at || 0) < throttleMs |
| 223 | ) { |
| 224 | return; |
| 225 | } |
| 226 | this._networkToastState = { type, at: now }; |
| 227 | if (type === 'warning') { |
| 228 | toast.warning(message, 2500); |
| 229 | return; |
| 230 | } |
| 231 | if (type === 'success') { |
| 232 | toast.success(message, 1800); |
| 233 | return; |
| 234 | } |
| 235 | toast.info(message, 2000); |
| 236 | } |
| 237 | |
| 238 | runWithConcurrency(task, priority = 'normal') { |
| 239 | return new Promise((resolve, reject) => { |
no test coverage detected