Skip to content

Commit

Permalink
fix: Make url variable accessible to all users of it
Browse files Browse the repository at this point in the history
Line 107 tries to use `url` but can't see it.

Also, clarify usage of window fields.

/puter/src/UI/UIWindowPublishWebsite.js
   67:67  error  'generate_identifier' is not defined  no-undef
  107:54  error  'url' is not defined                  no-undef
  110:17  error  'update_sites_cache' is not defined   no-undef
  • Loading branch information
AtkinsSJ committed May 2, 2024
1 parent e983e9e commit 2f30ae7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/UI/UIWindowPublishWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di
width: 450,
dominant: true,
onAppend: function(this_window){
$(this_window).find(`.publish-website-subdomain`).val(generate_identifier());
$(this_window).find(`.publish-website-subdomain`).val(window.generate_identifier());
$(this_window).find(`.publish-website-subdomain`).get(0).focus({preventScroll:true});
},
window_class: 'window-publishWebsite',
Expand All @@ -91,8 +91,8 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di
puter.hosting.create(
subdomain,
target_dir_path).then((res)=>{
let url = 'https://' + subdomain + '.' + window.hosting_domain + '/';
$(el_window).find('.window-publishWebsite-form').hide(100, function(){
let url = 'https://' + subdomain + '.' + window.hosting_domain + '/';
$(el_window).find('.publishWebsite-published-link').attr('href', url);
$(el_window).find('.publishWebsite-published-link').text(url);
$(el_window).find('.window-publishWebsite-success').show(100)
Expand All @@ -107,7 +107,7 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di
$(this).attr('data-website_url', url + $(this).attr('data-path').substring(target_dir_path.length));
})

update_sites_cache();
window.update_sites_cache();
}).catch((err)=>{
err = err.error;
$(el_window).find('.publish-website-error-msg').html(
Expand Down

0 comments on commit 2f30ae7

Please sign in to comment.