Skip to content

Commit 546c640

Browse files
Merge branch 'gui-deploy-workers' of https://github.com/HeyPuter/puter into gui-deploy-workers
2 parents a6d2706 + 5e190f3 commit 546c640

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/gui/src/UI/UIWindowPublishWorker.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ async function UIWindowPublishWorker(target_dir_uid, target_dir_name, target_dir
8585
//Worker name
8686
let worker_name = $(el_window).find('.publish-worker-name').val();
8787

88-
// disable 'Publish' button
89-
$(el_window).find('.publish-btn').prop('disabled', true);
88+
// Store original text and replace with spinner
89+
const originalText = $(el_window).find('.publish-btn').text();
90+
$(el_window).find('.publish-btn').prop('disabled', true).html(`
91+
<div style="display: inline-block; margin-top: 10px; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: 50%; border-top: 2px solid transparent; animation: spin 1s linear infinite;"></div>
92+
`);
9093

9194
puter.workers.create(
9295
worker_name,
@@ -115,8 +118,8 @@ async function UIWindowPublishWorker(target_dir_uid, target_dir_name, target_dir
115118
)
116119
);
117120
$(el_window).find('.publish-worker-error-msg').fadeIn();
118-
// re-enable 'Publish' button
119-
$(el_window).find('.publish-btn').prop('disabled', false);
121+
// re-enable 'Publish' button and restore original text
122+
$(el_window).find('.publish-btn').prop('disabled', false).text(originalText);
120123
})
121124
})
122125

0 commit comments

Comments
 (0)