From 78d5c7eb246f250454a66d35c3677f8b9dd140d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Todor=20Kondi=C4=87?= <todor.kondic@uni.lu>
Date: Thu, 7 May 2020 16:04:47 +0200
Subject: [PATCH] output$mzMLtabCtrl render: Updated.

* R/shiny-ui-config.R <mzMLtabCtrl>: Updated. Works together with the
  new, updated data files observers.
---
 R/shiny-ui-config.R | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/R/shiny-ui-config.R b/R/shiny-ui-config.R
index 3b81a25..2d17d9f 100644
--- a/R/shiny-ui-config.R
+++ b/R/shiny-ui-config.R
@@ -314,14 +314,14 @@ server_conf <- function(input,output,session,rv,rf,roots) {
     })
 
     output$mzMLtabCtrl <- rhandsontable::renderRHandsontable({
-        assert(rv$m$input$tab$setid, msg = "Compounds set table not built yet.")
-        tags <- unique(rf$get_tags_from_txt())
-        mzml <- rv$m$input$tab$mzml
-        message("mzml: ----")
-        print(mzml)
-        message("---- mzml")
-        all_sets <- unique(rv$m$input$tab$setid$set)
-        rhandsontable::rhandsontable(mzml2disp(mzml, sets = all_sets, tags = tags),stretchH="all")
+        df <- rv$work_mzml
+        if (!shiny::isTruthy(df)) {
+            assert(rv$m$input$tab$setid, msg = "Compounds set table not built yet.")
+            all_sets <- unique(rv$m$input$tab$setid$set)
+            txt_tags <- rf$get_tags_from_txt()
+            df <- mzml2disp(EMPTY_MZML, sets = all_sets, tags = txt_tags)
+        }
+        rhandsontable::rhandsontable(df,stretchH="all")
     })
     
     rv
-- 
GitLab