avoid showing the connection nudge alert after creating git or gcrypt remote

This commit is contained in:
Joey Hess 2014-04-20 15:10:29 -04:00
parent a8bd7a607d
commit 1a4c3caa96
2 changed files with 16 additions and 7 deletions

View file

@ -403,11 +403,14 @@ prepSsh' newgcrypt origsshdata sshdata keypair a = sshSetup
rsynconly = onlyCapability origsshdata RsyncCapable rsynconly = onlyCapability origsshdata RsyncCapable
makeSshRepo :: SshData -> Handler Html makeSshRepo :: SshData -> Handler Html
makeSshRepo sshdata = setupCloudRemote TransferGroup Nothing $ makeSshRepo sshdata
makeSshRemote sshdata | onlyCapability sshdata RsyncCapable = setupCloudRemote TransferGroup Nothing go
| otherwise = setupRemote EditNewRepositoryR TransferGroup Nothing go
where
go = makeSshRemote sshdata
makeGCryptRepo :: KeyId -> SshData -> Handler Html makeGCryptRepo :: KeyId -> SshData -> Handler Html
makeGCryptRepo keyid sshdata = setupCloudRemote TransferGroup Nothing $ makeGCryptRepo keyid sshdata = setupRemote EditNewRepositoryR TransferGroup Nothing $
makeGCryptRemote (sshRepoName sshdata) (genSshUrl sshdata) keyid makeGCryptRemote (sshRepoName sshdata) (genSshUrl sshdata) keyid
getAddRsyncNetR :: Handler Html getAddRsyncNetR :: Handler Html

View file

@ -26,12 +26,18 @@ import Utility.Yesod
{- Runs an action that creates or enables a cloud remote, {- Runs an action that creates or enables a cloud remote,
- and finishes setting it up, then starts syncing with it, - and finishes setting it up, then starts syncing with it,
- and finishes by displaying the page to edit it. -} - and finishes by displaying the page to edit it.
-
- This includes displaying the connectionNeeded nudge if appropariate.
-}
setupCloudRemote :: StandardGroup -> Maybe Cost -> Annex RemoteName -> Handler a setupCloudRemote :: StandardGroup -> Maybe Cost -> Annex RemoteName -> Handler a
setupCloudRemote defaultgroup mcost name = do setupCloudRemote = setupRemote EditNewCloudRepositoryR
r <- liftAnnex $ addRemote name
setupRemote :: (UUID -> Route WebApp) -> StandardGroup -> Maybe Cost -> Annex RemoteName -> Handler a
setupRemote redirto defaultgroup mcost getname = do
r <- liftAnnex $ addRemote getname
liftAnnex $ do liftAnnex $ do
setStandardGroup (Remote.uuid r) defaultgroup setStandardGroup (Remote.uuid r) defaultgroup
maybe noop (Config.setRemoteCost (Remote.repo r)) mcost maybe noop (Config.setRemoteCost (Remote.repo r)) mcost
liftAssistant $ syncRemote r liftAssistant $ syncRemote r
redirect $ EditNewCloudRepositoryR $ Remote.uuid r redirect $ redirto $ Remote.uuid r