From 989111857a338b1c66f5c5443c324d7151faa319 Mon Sep 17 00:00:00 2001
From: William Carroll <wpcarro@gmail.com>
Date: Mon, 23 Jan 2023 07:55:25 -0800
Subject: fix(wpcarro/ynabsql): Filter and sort transactions onUpload

:)

Change-Id: I8ae1dfb16885f2aa2d3416fadaf860bbe4e196fc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7915
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
---
 users/wpcarro/ynabsql/dataviz/components.jsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'users/wpcarro/ynabsql/dataviz/components.jsx')

diff --git a/users/wpcarro/ynabsql/dataviz/components.jsx b/users/wpcarro/ynabsql/dataviz/components.jsx
index a9c8e544b5a2..191c83743475 100644
--- a/users/wpcarro/ynabsql/dataviz/components.jsx
+++ b/users/wpcarro/ynabsql/dataviz/components.jsx
@@ -863,7 +863,14 @@ class App extends React.Component {
                         <li><a href="#" onClick={() => this.setState({ sensitive: !this.state.sensitive })}>sensitive</a></li>
                     </ul>
                 </nav>
-                <UploadJSON onUpload={xs => this.setState({ allTnransactions: xs })} />
+                <UploadJSON onUpload={xs => this.setState({
+                    allTransactions: xs,
+                    filteredTransactions: select(this.state.query, xs, {
+                        caseSensitive: this.state.slxCaseSensitive,
+                        preferRegex: this.state.slxPreferRegex,
+                        slxDateKey: this.state.slxDateKey,
+                    }).sort(compileSort(this.state.sortExpr))
+                })} />
                 {view}
             </div>
         );
-- 
cgit 1.4.1

