diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index 467a45c5..284ddd76 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -839,10 +839,13 @@ * @memberof Task */ async post(timeout=-1) { - performance.mark('make-render-request') - if (performance.getEntriesByName('click-makeImage', 'mark').length > 0) { - console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms') + if (typeof performance == "object" && performance.mark && performance.measure) { + performance.mark('make-render-request') + if (performance.getEntriesByName('click-makeImage', 'mark').length > 0) { + console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms') + } } + let jsonResponse = await super.post('/render', timeout) if (typeof jsonResponse?.task !== 'number') { console.warn('Endpoint error response: ', jsonResponse) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index b518c8c1..4b5c1bc3 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -429,7 +429,10 @@ function getUncompletedTaskEntries() { } function makeImage() { - performance.mark('click-makeImage') + if (typeof performance == "object" && performance.mark) { + performance.mark('click-makeImage') + } + if (!SD.isServerAvailable()) { alert('The server is not available.') return