From b80634df83eaf04d5f2540671e1d78c2215ce763 Mon Sep 17 00:00:00 2001 From: Aaron Greenspan Date: Tue, 12 Jan 2021 11:51:47 -0700 Subject: [PATCH] agent: remove redundant fn --- agent/src/Handler/Apps.hs | 2 +- agent/src/Lib/External/AppManifest.hs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/agent/src/Handler/Apps.hs b/agent/src/Handler/Apps.hs index 349106896..b4d0d71aa 100644 --- a/agent/src/Handler/Apps.hs +++ b/agent/src/Handler/Apps.hs @@ -253,7 +253,7 @@ getInstalledAppsLogic = do , appInstalledPreviewStatus = s , appInstalledPreviewVersionInstalled = v , appInstalledPreviewTorAddress = infoResTorAddress - , appInstalledPreviewUi = AppManifest.hasUi infoResManifest + , appInstalledPreviewUi = AppManifest.uiAvailable infoResManifest } pure $ HML.elems $ HML.union installingPreviews installedPreviews diff --git a/agent/src/Lib/External/AppManifest.hs b/agent/src/Lib/External/AppManifest.hs index 12c481c2e..92d124171 100644 --- a/agent/src/Lib/External/AppManifest.hs +++ b/agent/src/Lib/External/AppManifest.hs @@ -62,8 +62,8 @@ data AppManifest where , appManifestDependencies :: HM.HashMap AppId VersionRange } -> AppManifest -hasUi :: AppManifest -> Bool -hasUi AppManifest {..} = isJust $ HM.lookup 80 appManifestPortMapping +uiAvailable :: AppManifest -> Bool +uiAvailable AppManifest {..} = isJust $ HM.lookup 80 appManifestPortMapping instance FromJSON AppManifest where parseJSON = withObject "App Manifest " $ \o -> do @@ -89,7 +89,3 @@ getAppManifest appId = do base <- ask @"filesystemBase" ExceptT $ first (ManifestParseE appId) <$> liftIO (Yaml.decodeFileEither . toS $ (appMgrAppPath appId <> "manifest.yaml") `relativeTo` base) - -uiAvailable :: AppManifest -> Bool -uiAvailable = \case - AppManifest { appManifestPortMapping } -> elem 80 (HM.keys appManifestPortMapping)