Removed incorrect item storage and unnecessary mixed types

This commit is contained in:
Liam Cardenas 2017-11-29 14:43:27 -08:00
parent 74de4aac3d
commit a0e1b7b88e

View file

@ -15,12 +15,12 @@ type appState = {
modal: mixed, modal: mixed,
modalProps: mixed, modalProps: mixed,
platform: string, platform: string,
upgradeSkipped: mixed, upgradeSkipped: boolean,
daemonVersionMatched: mixed, daemonVersionMatched: ?boolean,
daemonReady: boolean, daemonReady: boolean,
hasSignature: boolean, hasSignature: boolean,
badgeNumber: number, badgeNumber: number,
volume: mixed, volume: number,
downloadProgress?: number, downloadProgress?: number,
upgradeDownloading?: boolean, upgradeDownloading?: boolean,
upgradeDownloadComplete?: boolean, upgradeDownloadComplete?: boolean,
@ -34,12 +34,12 @@ const defaultState: appState = {
modal: null, modal: null,
modalProps: {}, modalProps: {},
platform: process.platform, platform: process.platform,
upgradeSkipped: sessionStorage.getItem("upgradeSkipped"), upgradeSkipped: sessionStorage.getItem("upgradeSkipped") === "true",
daemonVersionMatched: null, daemonVersionMatched: null,
daemonReady: false, daemonReady: false,
hasSignature: false, hasSignature: false,
badgeNumber: 0, badgeNumber: 0,
volume: sessionStorage.getItem("volume") || 1, volume: Number(sessionStorage.getItem("volume")) || 1,
}; };
reducers[types.DAEMON_READY] = function(state, action) { reducers[types.DAEMON_READY] = function(state, action) {
@ -84,8 +84,7 @@ reducers[types.UPGRADE_DOWNLOAD_STARTED] = function(state, action) {
}; };
reducers[types.SKIP_UPGRADE] = function(state, action) { reducers[types.SKIP_UPGRADE] = function(state, action) {
// $FlowFixMe: Interest error here, it appears that setItem is expecting string, not a boolean as the data parameter sessionStorage.setItem("upgradeSkipped", "true");
sessionStorage.setItem("upgradeSkipped", true);
return Object.assign({}, state, { return Object.assign({}, state, {
isUpgradeSkipped: true, isUpgradeSkipped: true,