From b665a125ed298132ce7c19ccf7c9ee7dfcba7f3c Mon Sep 17 00:00:00 2001 From: Ryan Trinkle Date: Fri, 24 Sep 2021 15:56:33 -0400 Subject: [PATCH] Add a loading indicator for the wallet account list --- use-case-2/frontend/src/Frontend/ChooseWallet.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/use-case-2/frontend/src/Frontend/ChooseWallet.hs b/use-case-2/frontend/src/Frontend/ChooseWallet.hs index 24013bfb4..042edffa8 100644 --- a/use-case-2/frontend/src/Frontend/ChooseWallet.hs +++ b/use-case-2/frontend/src/Frontend/ChooseWallet.hs @@ -57,6 +57,8 @@ chooseWallet = do dmmWalletIds <- viewContracts dyn_ $ ffor dmmWalletIds $ \case Nothing -> do + el "p" $ text "Loading..." + Just [] -> do el "p" $ text "There are no wallets yet available." el "p" $ text "If the contract is still initializing, just wait. They will appear here once created." Just walletIds -> do @@ -69,5 +71,5 @@ viewContracts :: ( MonadQuery t (Vessel Q (Const SelectedCount)) m , Reflex t ) - => m (Dynamic t (Maybe ([Text]))) + => m (Dynamic t (Maybe [Text])) viewContracts = (fmap.fmap.fmap) (Map.elems . Map.mapMaybe getFirst . runIdentity) $ queryViewMorphism 1 $ constDyn $ vessel Q_ContractList . identityV