Merge branch 'refresh-first-pg' of sloum/bombadillo into develop

Merges in a fix to using the _reload_ command when on the first history location. It was previously not working.
This commit is contained in:
Sloom Sloum Sluom IV 2019-12-08 23:21:42 -05:00 committed by Gitea
commit ccc694fb2f
1 changed files with 7 additions and 3 deletions

View File

@ -726,9 +726,13 @@ func (c *client) ReloadPage() error {
return fmt.Errorf("There is no page to reload")
}
url := c.PageState.History[c.PageState.Position].Location.Full
err := c.PageState.NavigateHistory(-1)
if err != nil {
return err
if c.PageState.Position == 0 {
c.PageState.Position--
} else {
err := c.PageState.NavigateHistory(-1)
if err != nil {
return err
}
}
length := c.PageState.Length
c.Visit(url)