A local-first personal finance app
Fix display of loading indicator in management app (#853)
Jed Fox6ef1f3d15d48
diff --git a/packages/desktop-client/src/components/App.js b/packages/desktop-client/src/components/App.jsindex dd85f1474d..5568e7a6da 100644--- a/packages/desktop-client/src/components/App.js+++ b/packages/desktop-client/src/components/App.js@@ -114,13 +114,13 @@ class App extends React.Component {) : budgetId ? (<FinancesApp />) : (- <React.Fragment>+ <><AppBackgroundinitializing={initializing}loadingText={loadingText}/>- <ManagementApp />- </React.Fragment>+ <ManagementApp isLoading={loadingText != null} />+ </>)}<UpdateNotification />diff --git a/packages/desktop-client/src/components/manager/ImportActual.js b/packages/desktop-client/src/components/manager/ImportActual.jsindex fc6c0edc4c..58aaa4ba2e 100644--- a/packages/desktop-client/src/components/manager/ImportActual.js+++ b/packages/desktop-client/src/components/manager/ImportActual.js@@ -64,7 +64,7 @@ function Import({ modalProps, availableImports }) {<P>You can import data from another Actual account or instance. Firstexport your data from a different account, and it will give you a- compressed file. This file is a simple zip file that contains the+ compressed file. This file is a simple zip file that contains the{' '}<code>db.sqlite</code> and <code>metadata.json</code> files.</P>diff --git a/packages/desktop-client/src/components/manager/ManagementApp.js b/packages/desktop-client/src/components/manager/ManagementApp.jsindex e8add431e6..682fe0a97f 100644--- a/packages/desktop-client/src/components/manager/ManagementApp.js+++ b/packages/desktop-client/src/components/manager/ManagementApp.js@@ -50,9 +50,9 @@ function Version() {}function ManagementApp({+ isLoading,files,userData,- loadingText,managerHasInitialized,setAppState,getUserData,@@ -66,7 +66,6 @@ function ManagementApp({// An action may have been triggered from outside, and we don't// want to override its loading message so we only show the// initial loader if there isn't already a message- let alreadyLoading = loadingText != null;// Remember: this component is remounted every time the user// closes a budget. That's why we keep `managerHasInitialized` in@@ -74,7 +73,7 @@ function ManagementApp({// loading spinner on first run, but never again since we'll have// a cached list of files and can show themif (!managerHasInitialized) {- if (!alreadyLoading) {+ if (!isLoading) {setAppState({ loadingText: '' });}}@@ -86,13 +85,13 @@ function ManagementApp({}// TODO: There is a race condition here. The user could perform an- // action that starts loading in between where `alreadyLoading`+ // action that starts loading in between where `isLoading`// was captured and this would clear it. We really only want to// ever clear the initial loading screen, so we need a "loading// id" of some kind.setAppState({managerHasInitialized: true,- ...(!alreadyLoading ? { loadingText: null } : null),+ ...(!isLoading ? { loadingText: null } : null),});}@@ -103,6 +102,10 @@ function ManagementApp({return null;}+ if (isLoading) {+ return null;+ }+return (<Router history={history}><View style={{ height: '100%' }}>@@ -215,7 +218,6 @@ export default connect(state => {files: state.budgets.allFiles,userData: state.user.data,managerHasInitialized: state.app.managerHasInitialized,- loadingText: state.app.loadingText,currentModals: modalStack.map(modal => modal.name),};}, actions)(ManagementApp);diff --git a/upcoming-release-notes/853.md b/upcoming-release-notes/853.mdnew file mode 100644index 0000000000..9e400f690b--- /dev/null+++ b/upcoming-release-notes/853.md@@ -0,0 +1,6 @@+---+category: Bugfix+authors: [j-f1]+---++Hide the file list/import screens when loading a budget