Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yazz committed Jul 24, 2023
1 parent 5c8c8aa commit b7cbc30
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,11 @@ async function file_uploadFn ( req , res , next
localSourceFilePath = path.join(userData, 'uploads/' + ifile.filename);
let fullLocalSourceFilePath = localSourceFilePath + '.' + ext;
fs.renameSync(localSourceFilePath, fullLocalSourceFilePath);
await loadAppFromFile(fullLocalSourceFilePath,client_file_upload_id)
await loadAppFromFile(
{
localFilePath: fullLocalSourceFilePath,
client_file_upload_id: client_file_upload_id
})
} else {
outputDebug('Ignoring file ');

Expand All @@ -2400,11 +2404,14 @@ async function file_uploadFn ( req , res , next
};
async function file_name_load ( req , res , next ) {
//console.log("params: " + JSON.stringify(req.query,null,2))
await loadAppFromFile( req.query.file_name_load,
req.query.client_file_upload_id)
await loadAppFromFile(
{
localFilePath: req.query.file_name_load,
client_file_upload_id: req.query.client_file_upload_id
})
};
async function loadAppFromFile ( localp , client_file_upload_id ) {
let readIn = fs.readFileSync(localp).toString()
async function loadAppFromFile ( { localFilePath , client_file_upload_id } ) {
let readIn = fs.readFileSync( localFilePath ).toString()
let bci = yz.helpers.getValueOfCodeString(readIn, "base_component_id")

await save_code_from_upload({
Expand All @@ -2416,7 +2423,7 @@ async function loadAppFromFile ( localp , client_fil
options: {
save_html: true,
fast_forward_database_to_latest_revision: false,
save_code_to_file: localp
save_code_to_file: localFilePath
},
sqlite_data: ""
});
Expand Down

0 comments on commit b7cbc30

Please sign in to comment.