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.

This commit is contained in:
Joey Hess 2013-06-11 00:06:06 -04:00
parent 768f7c87f2
commit 680d3b5120
3 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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

3
debian/changelog vendored
View file

@ -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 <joeyh@debian.org> Mon, 10 Jun 2013 12:52:44 -0400