A couple of little fixes #371
1 changed files with 2 additions and 5 deletions
|
@ -13,6 +13,7 @@ import { doSearch } from "actions/search";
|
||||||
import { doFetchDaemonSettings } from "actions/settings";
|
import { doFetchDaemonSettings } from "actions/settings";
|
||||||
import { doAuthenticate } from "actions/user";
|
import { doAuthenticate } from "actions/user";
|
||||||
import { doFileList } from "actions/file_info";
|
import { doFileList } from "actions/file_info";
|
||||||
|
import { toQueryString } from "util/query_params";
|
||||||
|
|
||||||
const { remote, ipcRenderer, shell } = require("electron");
|
const { remote, ipcRenderer, shell } = require("electron");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
@ -20,14 +21,10 @@ const { download } = remote.require("electron-dl");
|
||||||
const fs = remote.require("fs");
|
const fs = remote.require("fs");
|
||||||
const { lbrySettings: config } = require("../../../app/package.json");
|
const { lbrySettings: config } = require("../../../app/package.json");
|
||||||
|
|
||||||
const queryStringFromParams = params => {
|
|
||||||
return Object.keys(params).map(key => `${key}=${params[key]}`).join("&");
|
|
||||||
};
|
|
||||||
|
|
||||||
export function doNavigate(path, params = {}) {
|
export function doNavigate(path, params = {}) {
|
||||||
return function(dispatch, getState) {
|
return function(dispatch, getState) {
|
||||||
let url = path;
|
let url = path;
|
||||||
if (params) url = `${url}?${queryStringFromParams(params)}`;
|
if (params) url = `${url}?${toQueryString(params)}`;
|
||||||
|
|
||||||
dispatch(doChangePath(url));
|
dispatch(doChangePath(url));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue