From 5bd5e604ad747bdd22c27a31e587f7d986a169de Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 27 Sep 2013 00:35:37 -0400 Subject: [PATCH] remove another sum type that was only needed to work around a bug in old yesod And the bug is only a warning message at compile time.. --- Assistant/WebApp/Notifications.hs | 2 +- Assistant/WebApp/RepoList.hs | 5 +++-- Assistant/WebApp/Types.hs | 7 ------- Assistant/WebApp/routes | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Assistant/WebApp/Notifications.hs b/Assistant/WebApp/Notifications.hs index b9da401781..6749abb723 100644 --- a/Assistant/WebApp/Notifications.hs +++ b/Assistant/WebApp/Notifications.hs @@ -80,7 +80,7 @@ getNotifierBuddyListR = notifierUrl BuddyListR getBuddyListBroadcaster getNotifierRepoListR :: RepoSelector -> Handler RepPlain getNotifierRepoListR reposelector = notifierUrl route getRepoListBroadcaster where - route nid = RepoListR $ RepoListNotificationId nid reposelector + route nid = RepoListR nid reposelector getTransferBroadcaster :: Assistant NotificationBroadcaster getTransferBroadcaster = transferNotifier <$> getDaemonStatus diff --git a/Assistant/WebApp/RepoList.hs b/Assistant/WebApp/RepoList.hs index 4e5c4fea73..c0edf0c530 100644 --- a/Assistant/WebApp/RepoList.hs +++ b/Assistant/WebApp/RepoList.hs @@ -27,6 +27,7 @@ import Git.Config import Git.Remote import Assistant.Sync import Config.Cost +import Utility.NotificationBroadcaster import qualified Git #ifdef WITH_XMPP #endif @@ -83,8 +84,8 @@ notWanted _ = False - - Returns a div, which will be inserted into the calling page. -} -getRepoListR :: RepoListNotificationId -> Handler Html -getRepoListR (RepoListNotificationId nid reposelector) = do +getRepoListR :: NotificationId -> RepoSelector -> Handler Html +getRepoListR nid reposelector = do waitNotifier getRepoListBroadcaster nid p <- widgetToPageContent $ repoListDisplay reposelector giveUrlRenderer $ [hamlet|^{pageBody p}|] diff --git a/Assistant/WebApp/Types.hs b/Assistant/WebApp/Types.hs index 512db1ba24..618a8dece2 100644 --- a/Assistant/WebApp/Types.hs +++ b/Assistant/WebApp/Types.hs @@ -150,9 +150,6 @@ data RepoSelector = RepoSelector } deriving (Read, Show, Eq) -data RepoListNotificationId = RepoListNotificationId NotificationId RepoSelector - deriving (Read, Show, Eq) - data RemovableDrive = RemovableDrive { diskFree :: Maybe Integer , mountPoint :: Text @@ -207,10 +204,6 @@ instance PathPiece PairKey where toPathPiece = pack . show fromPathPiece = readish . unpack -instance PathPiece RepoListNotificationId where - toPathPiece = pack . show - fromPathPiece = readish . unpack - instance PathPiece RepoSelector where toPathPiece = pack . show fromPathPiece = readish . unpack diff --git a/Assistant/WebApp/routes b/Assistant/WebApp/routes index 2db8a0fdc9..813c10b2d8 100644 --- a/Assistant/WebApp/routes +++ b/Assistant/WebApp/routes @@ -90,7 +90,7 @@ /buddylist/#NotificationId BuddyListR GET /notifier/buddylist NotifierBuddyListR GET -/repolist/#RepoListNotificationId RepoListR GET +/repolist/#NotificationId/#RepoSelector RepoListR GET /notifier/repolist/#RepoSelector NotifierRepoListR GET /alert/close/#AlertId CloseAlert GET