Skip to content

Commit

Permalink
testing environment variable LOCAL for js
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Dec 18, 2024
1 parent ce6f386 commit 204bd2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Direct_Test_App.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ library(COMELN)
library(httr)
library(jose)
library(openssl)
Sys.setenv(RUN_MODE = "BROWSER")
Sys.setenv(RUN_MODE = "LOCAL")
setwd("bs/R")
files <- list.files(".")
lapply(files, source)
app <- app()
shiny::shinyApp(app$ui, app$server)

4 changes: 3 additions & 1 deletion app/MainApp.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

js_scripts <- function() {
if (Sys.getenv("RUN_MODE") != "SERVER") {
if (Sys.getenv("RUN_MODE") == "BROWSER") {
tagList(
includeScript("www/FileSaver.min.js"),
includeScript("www/html2canvas.min.js"),
Expand Down Expand Up @@ -355,7 +355,9 @@ app <- function() {

output$conditional_data_ui <- renderUI({
showNotification(Sys.getenv("RUN_MODE"), duration = 0)
showNotification(as.character(Sys.getenv("RUN_MODE") != "SERVER"), duration = 0)
if (Sys.getenv("RUN_MODE") != "SERVER") {
showNotification("Test", duration = 0)
res <- conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
Expand Down
3 changes: 2 additions & 1 deletion bs/R/MainApp.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

js_scripts <- function() {
if (Sys.getenv("RUN_MODE") != "SERVER") {
if (Sys.getenv("RUN_MODE") == "BROWSER") {
tagList(
includeScript("www/FileSaver.min.js"),
includeScript("www/html2canvas.min.js"),
Expand Down Expand Up @@ -355,6 +355,7 @@ app <- function() {

output$conditional_data_ui <- renderUI({
showNotification(Sys.getenv("RUN_MODE"), duration = 0)
showNotification(as.character(Sys.getenv("RUN_MODE") != "SERVER"), duration = 0)
if (Sys.getenv("RUN_MODE") != "SERVER") {
showNotification("Test", duration = 0)
res <- conditionalPanel(
Expand Down

0 comments on commit 204bd2b

Please sign in to comment.