forked from mirror/ObjToSchematic
Fixed actions remaining disabled on error
This commit is contained in:
parent
f8f57ba0b8
commit
500ff9b690
@ -94,6 +94,12 @@ export class AppContext {
|
||||
'error',
|
||||
);
|
||||
LOG_ERROR(payload.error);
|
||||
|
||||
this._ui.getActionButton(action)
|
||||
.stopLoading()
|
||||
.setProgress(0.0);
|
||||
|
||||
this._ui.enableTo(action);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -33,7 +33,7 @@ export class ProgressManager {
|
||||
* @param taskId The id of the task (created here).
|
||||
*/
|
||||
public start(taskId: TTaskID): TTaskHandle {
|
||||
ASSERT(!this._tasks.includes(taskId), 'Task with that Id already being tracked');
|
||||
ASSERT(!this._tasks.includes(taskId), `Task with id '${taskId}' already being tracked`);
|
||||
this._tasks.push(taskId);
|
||||
EventManager.Get.broadcast(EAppEvent.onTaskStart, taskId);
|
||||
|
||||
@ -65,4 +65,8 @@ export class ProgressManager {
|
||||
this._tasks.splice(taskIndex, 1);
|
||||
EventManager.Get.broadcast(EAppEvent.onTaskEnd, tracker.id);
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this._tasks = [];
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { ProgressManager } from './progress';
|
||||
import { StatusHandler } from './status';
|
||||
import { AppError } from './util/error_util';
|
||||
import { WorkerClient } from './worker_client';
|
||||
@ -5,6 +6,8 @@ import { TFromWorkerMessage, TToWorkerMessage } from './worker_types';
|
||||
|
||||
export function doWork(message: TToWorkerMessage): TFromWorkerMessage {
|
||||
StatusHandler.Get.clear();
|
||||
ProgressManager.Get.clear();
|
||||
|
||||
try {
|
||||
switch (message.action) {
|
||||
case 'Import':
|
||||
|
Loading…
Reference in New Issue
Block a user