fix(ui): clear last progress event on invocation/queue item complete

Fixes an issue where indeterminate progress wasn't shown.
This commit is contained in:
psychedelicious
2024-09-19 21:51:10 +10:00
parent 50f382f269
commit d1ff33e9dc
2 changed files with 6 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import { boardsApi } from 'services/api/endpoints/boards';
import { getImageDTO, imagesApi } from 'services/api/endpoints/images';
import type { ImageDTO, S } from 'services/api/types';
import { getCategories, getListImagesUrl } from 'services/api/util';
import { $lastProgressEvent } from 'services/events/stores';
const log = logger('events');
@@ -159,5 +160,7 @@ export const buildOnInvocationComplete = (getState: () => RootState, dispatch: A
} else {
await handleOriginOther(data);
}
$lastProgressEvent.set(null);
};
};

View File

@@ -423,6 +423,9 @@ export const setEventListeners = ({ socket, store, setIsConnected }: SetEventLis
/>
),
});
} else if (status === 'completed' || status === 'failed' || status === 'canceled') {
// If the queue item is completed, failed, or cancelled, we want to clear the last progress event
$lastProgressEvent.set(null);
}
});