From 680d3b5120ee56b00d3c139d18017ad7d1d87f1f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Jun 2013 00:06:06 -0400 Subject: [PATCH] webapp: When the user switches to display a different repository, that repository becomes the default repository to be displayed next time the webapp gets started. --- Assistant/WebApp/OtherRepos.hs | 1 + Config/Files.hs | 4 +++- debian/changelog | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assistant/WebApp/OtherRepos.hs b/Assistant/WebApp/OtherRepos.hs index 5f3ae4a28b..2dfe844c8a 100644 --- a/Assistant/WebApp/OtherRepos.hs +++ b/Assistant/WebApp/OtherRepos.hs @@ -43,6 +43,7 @@ listOtherRepos = do getSwitchToRepositoryR :: FilePath -> Handler RepHtml getSwitchToRepositoryR repo = do liftIO $ startAssistant repo + liftIO $ addAutoStartFile repo -- make this the new default repo redirect =<< liftIO geturl where geturl = do diff --git a/Config/Files.hs b/Config/Files.hs index 23564c2df5..3db2bb74c3 100644 --- a/Config/Files.hs +++ b/Config/Files.hs @@ -36,7 +36,9 @@ modifyAutoStartFile func = do createDirectoryIfMissing True (parentDir f) viaTmp writeFile f $ unlines $ dirs' -{- Adds a directory to the autostart file. -} +{- Adds a directory to the autostart file. If the directory is already + - present, it's moved to the top, so it will be used as the default + - when opening the webapp. -} addAutoStartFile :: FilePath -> IO () addAutoStartFile path = modifyAutoStartFile $ (:) path diff --git a/debian/changelog b/debian/changelog index d9c1f798d0..cf57b5cf3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ git-annex (4.20130602) UNRELEASED; urgency=low repository. * Android: Make the "Open webapp" menu item open the just created repository when a new repo is made. + * webapp: When the user switches to display a different repository, + that repository becomes the default repository to be displayed next time + the webapp gets started. -- Joey Hess Mon, 10 Jun 2013 12:52:44 -0400