forked from sloum/bombadillo
Makes the first history position reloadable
This commit is contained in:
parent
3a226f3769
commit
2c9c00ab8d
|
@ -726,10 +726,14 @@ func (c *client) ReloadPage() error {
|
||||||
return fmt.Errorf("There is no page to reload")
|
return fmt.Errorf("There is no page to reload")
|
||||||
}
|
}
|
||||||
url := c.PageState.History[c.PageState.Position].Location.Full
|
url := c.PageState.History[c.PageState.Position].Location.Full
|
||||||
|
if c.PageState.Length == 1 {
|
||||||
|
c.PageState.Position--
|
||||||
|
} else {
|
||||||
err := c.PageState.NavigateHistory(-1)
|
err := c.PageState.NavigateHistory(-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
length := c.PageState.Length
|
length := c.PageState.Length
|
||||||
c.Visit(url)
|
c.Visit(url)
|
||||||
c.PageState.Length = length
|
c.PageState.Length = length
|
||||||
|
|
Loading…
Reference in New Issue