Fix refresh regression after adding scroll position to history state #380

Merged
6ea86b96 merged 2 commits from refresh-fix into master 2017-07-24 23:31:25 +02:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 7671787a63 - Show all commits

View file

@ -31,6 +31,7 @@ Web UI version numbers should always match the corresponding version of LBRY App
* Fixed files on downloaded tab not showing download progress
* Fixed downloading files that are deleted not being removed from the downloading list
* Fixed download progress bar not being cleared when a downloading file is deleted
* Fixed refresh regression after adding scroll position to history state
### Deprecated
*

View file

@ -14,6 +14,7 @@ import { doFetchDaemonSettings } from "actions/settings";
import { doAuthenticate } from "actions/user";
import { doFileList } from "actions/file_info";
import { toQueryString } from "util/query_params";
import { parseQueryParams } from "util/query_params";
const { remote, ipcRenderer, shell } = require("electron");
const path = require("path");
@ -63,6 +64,7 @@ export function doChangePath(path, options = {}) {
export function doHistoryBack() {
return function(dispatch, getState) {
if (!history.state) return;
if (history.state.index === 0) return;
history.back();
};
@ -249,7 +251,9 @@ export function doAlertError(errorList) {
export function doDaemonReady() {
return function(dispatch, getState) {
history.replaceState({}, document.title, `#/discover`);
const path = window.location.hash || "#/discover";
const params = parseQueryParams(path.split("?")[1] || "");
history.replaceState({ params, index: 0 }, document.title, `${path}`);
dispatch(doAuthenticate());
dispatch({
type: types.DAEMON_READY,