Skip to content

Commit

Permalink
Add only_run_on_frontend(true) if you want code to run in browser
Browse files Browse the repository at this point in the history
Otherwise the code could be executed on the server
  • Loading branch information
yazz committed May 25, 2020
1 parent 1d74e9c commit 5b287ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions public/visifile_drivers/apps/bubblesort.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ base_component_id("bubblesort")
display_name("Bubble sort")
is_app(true)
visibility("PUBLIC")
only_run_on_frontend(true)
read_only(true)
logo_url("/bubblesort.jpeg")
*/
Expand Down
1 change: 1 addition & 0 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,7 @@ function isFrontEndOnlyCode(code) {
}
if (code.indexOf("Vue.") != -1) { return true }
if (code.indexOf("only_run_on_server(") != -1) { return false }
if (code.indexOf("only_run_on_frontend(") != -1) { return true }
if (code.indexOf("rest_api(") != -1) { return false }
return false
}
Expand Down
1 change: 1 addition & 0 deletions src/exeProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ process.on('uncaughtException', function (err) {
function isFrontEndOnlyCode(code) {
if (code.indexOf("Vue.") != -1) { return true }
if (code.indexOf("only_run_on_server(") != -1) { return false }
if (code.indexOf("only_run_on_frontend(") != -1) { return true }
if (code.indexOf("rest_api(") != -1) { return false }
return false
}
Expand Down

0 comments on commit 5b287ff

Please sign in to comment.