Skip to content

Commit

Permalink
fix file upload bug
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Dec 4, 2023
1 parent 84d5daf commit 3a31db0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ server <- function(input, output, session) {
})

shiny::observeEvent(input$resetData, {
print("resetting data")
print("Resetting data...")
data1$matrix <- NULL
data2$matrix <- NULL
correlationMatrix$corr_matrix <- NULL
Expand All @@ -56,10 +56,14 @@ server <- function(input, output, session) {
upload_state$file2 <- "reset"
})

shiny::observeEvent({
upload_state$file1
upload_state$file2
}, {
listenForFileUPloads <- reactive({
list(upload_state$file1, upload_state$file2)
})

shiny::observeEvent(listenForFileUPloads(), {
if (is.null(input$fileUpload) && is.null(input$fileUpload2)) {
return(NULL)
}
if (upload_state$file1 == 'reset' && upload_state$file2 == 'reset') {
file1 <- NULL
file2 <- NULL
Expand Down Expand Up @@ -170,7 +174,7 @@ server <- function(input, output, session) {
p_value = meltedPVals[['value']]
)
}

return(edge_list)
})

Expand Down

0 comments on commit 3a31db0

Please sign in to comment.