diff --git a/src/gui/src/UI/UIWindowPublishWorker.js b/src/gui/src/UI/UIWindowPublishWorker.js index 2084799bc..3a759cd16 100644 --- a/src/gui/src/UI/UIWindowPublishWorker.js +++ b/src/gui/src/UI/UIWindowPublishWorker.js @@ -103,10 +103,12 @@ async function UIWindowPublishWorker (target_dir_uid, target_dir_name, target_di const sandboxed = $(el_window).find('.publish-worker-sandboxed').is(':checked'); const createOptions = sandboxed ? { sandbox: true } : { sandbox: false }; - puter.workers.create(worker_name, - target_dir_path, - createOptions).then((res) => { - let url = `https://${ worker_name }.puter.work`; + puter.workers.create( + worker_name, + target_dir_path, + createOptions, + ).then((res) => { + let url = `https://${ worker_name }.puter.work`; $(el_window).find('.window-publishWorker-form').hide(100, function () { $(el_window).find('.publishWorker-published-link').attr('href', url); $(el_window).find('.publishWorker-published-link').text(url); @@ -121,25 +123,25 @@ async function UIWindowPublishWorker (target_dir_uid, target_dir_name, target_di // update item's website_url attribute // $(this).attr('data-website_url', url + $(this).attr('data-path').substring(target_dir_path.length)); }); - }).catch((err) => { - let errorHtml; - // Handle worker service errors (result.success === false) - if ( ! (err instanceof Error) ) { - // Handle regular API errors - const error = err.error || err; - errorHtml = error.message + ( - error.code === 'subdomain_limit_reached' ? - ` ${ i18n('manage_your_subdomains') }` : '' - ); - } else { - errorHtml = `
${html_encode(err)}`;
- }
+ }).catch((err) => {
+ let errorHtml;
+ // Handle worker service errors (result.success === false)
+ if ( ! (err instanceof Error) ) {
+ // Handle regular API errors
+ const error = err.error || err;
+ errorHtml = error.message + (
+ error.code === 'subdomain_limit_reached' ?
+ ` ${ i18n('manage_your_subdomains') }` : ''
+ );
+ } else {
+ errorHtml = `${html_encode(err.message)}`;
+ }
$(el_window).find('.publish-worker-error-msg').html(errorHtml);
$(el_window).find('.publish-worker-error-msg').fadeIn();
// re-enable 'Publish' button and restore original text
$(el_window).find('.publish-btn').prop('disabled', false).text(originalText);
- });
+ });
});
$(el_window).find('.publish-window-ok-btn').on('click', function () {