[Refactoring] [Attempt to fix crash]
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
import {showWindow, shutdownApplication} from './common_actions';
|
import {
|
||||||
|
showWindow,
|
||||||
|
shutdownApplication
|
||||||
|
} from './common_actions';
|
||||||
|
|
||||||
let ErrorActions = [];
|
let ErrorActions = [];
|
||||||
|
|
||||||
@@ -27,7 +30,7 @@ export const dismissError = () => {
|
|||||||
export const notifyError = (msg, critical, callback) => {
|
export const notifyError = (msg, critical, callback) => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
ErrorActions = [callback, ...ErrorActions];
|
ErrorActions = [callback, ...ErrorActions];
|
||||||
msg = msg.toString();
|
msg = msg ? msg.toString() : 'Unknown Error';
|
||||||
dispatch(setErrorInfo(msg, critical));
|
dispatch(setErrorInfo(msg, critical));
|
||||||
dispatch(showWindow());
|
dispatch(showWindow());
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import * as Constants from '../../constants';
|
import * as Constants from '../../constants';
|
||||||
import {createAction} from 'redux-starter-kit';
|
import {createAction} from 'redux-starter-kit';
|
||||||
import {setApplicationReady} from './common_actions';
|
|
||||||
import {notifyError} from './error_actions';
|
import {notifyError} from './error_actions';
|
||||||
|
import {setApplicationReady} from './common_actions';
|
||||||
|
|
||||||
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
|
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
|
||||||
export const clearUIUpgrade = () => {
|
export const clearUIUpgrade = () => {
|
||||||
@@ -75,7 +75,7 @@ export const loadReleases = () => {
|
|||||||
}));
|
}));
|
||||||
dispatchActions(locationsLookup, versionLookup);
|
dispatchActions(locationsLookup, versionLookup);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
const releases = window.localStorage.getItem('releases');
|
const releases = localStorage.getItem('releases');
|
||||||
if (releases && (releases.length > 0)) {
|
if (releases && (releases.length > 0)) {
|
||||||
const obj = JSON.parse(releases);
|
const obj = JSON.parse(releases);
|
||||||
const locationsLookup = obj.LocationsLookup;
|
const locationsLookup = obj.LocationsLookup;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {createReducer} from "redux-starter-kit";
|
import {createReducer} from 'redux-starter-kit';
|
||||||
import {setApplicationReady} from "../actions/common_actions";
|
import {setApplicationReady} from '../actions/common_actions';
|
||||||
|
|
||||||
export const createCommonReducer = (platform, appPlatform, version) => {
|
export const createCommonReducer = (platform, appPlatform, version) => {
|
||||||
return createReducer({
|
return createReducer({
|
||||||
AppReady: false,
|
|
||||||
AppPlatform: appPlatform,
|
AppPlatform: appPlatform,
|
||||||
|
AppReady: false,
|
||||||
Platform: platform,
|
Platform: platform,
|
||||||
Version: version,
|
Version: version,
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
import {createReducer} from 'redux-starter-kit';
|
import {createReducer} from 'redux-starter-kit';
|
||||||
import {setAllowDownload, SET_DOWNLOAD_BEGIN, setDownloadEnd, setDownloadProgress} from '../actions/download_actions';
|
import {
|
||||||
|
setAllowDownload,
|
||||||
|
SET_DOWNLOAD_BEGIN,
|
||||||
|
setDownloadEnd,
|
||||||
|
setDownloadProgress
|
||||||
|
} from '../actions/download_actions';
|
||||||
|
|
||||||
const defaultDownloadState = {
|
const defaultDownloadState = {
|
||||||
DownloadActive: false,
|
DownloadActive: false,
|
||||||
DownloadProgress: 0.0,
|
|
||||||
DownloadingDependency: false,
|
DownloadingDependency: false,
|
||||||
DownloadName: '',
|
|
||||||
DownloadType: null,
|
|
||||||
DownloadingRelease: false,
|
DownloadingRelease: false,
|
||||||
|
DownloadingUpgrade: false,
|
||||||
|
DownloadName: '',
|
||||||
|
DownloadProgress: 0.0,
|
||||||
DownloadResult: null,
|
DownloadResult: null,
|
||||||
DownloadingUpgrade: false
|
DownloadType: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const downloadReducer = createReducer({
|
export const downloadReducer = createReducer({
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import {createReducer} from 'redux-starter-kit';
|
import {createReducer} from 'redux-starter-kit';
|
||||||
import {CLEAR_ERROR, SET_ERROR_INFO} from '../actions/error_actions';
|
import {
|
||||||
|
CLEAR_ERROR,
|
||||||
|
SET_ERROR_INFO
|
||||||
|
} from '../actions/error_actions';
|
||||||
|
|
||||||
export const errorReducer = createReducer({
|
export const errorReducer = createReducer({
|
||||||
DisplayError: false,
|
DisplayError: false,
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import {createReducer} from 'redux-starter-kit';
|
import {createReducer} from 'redux-starter-kit';
|
||||||
import {setInstallActive, setInstallComplete, setMissingDependencies} from '../actions/install_actions';
|
import {
|
||||||
|
setInstallActive,
|
||||||
|
setInstallComplete,
|
||||||
|
setMissingDependencies
|
||||||
|
} from '../actions/install_actions';
|
||||||
|
|
||||||
export const installReducer = createReducer({
|
export const installReducer = createReducer({
|
||||||
InstallActive: false,
|
InstallActive: false,
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
import * as Constants from '../../constants';
|
import * as Constants from '../../constants';
|
||||||
import {createReducer} from 'redux-starter-kit';
|
import {createReducer} from 'redux-starter-kit';
|
||||||
import {displayConfiguration, SET_ALLOW_MOUNT, setAutoMountProcessed, setBusy, SET_MOUNT_STATE, SET_MOUNTED, SET_PROVIDER_STATE} from '../actions/mount_actions';
|
import {
|
||||||
|
displayConfiguration,
|
||||||
|
SET_ALLOW_MOUNT,
|
||||||
|
setAutoMountProcessed,
|
||||||
|
setBusy,
|
||||||
|
SET_MOUNT_STATE,
|
||||||
|
SET_MOUNTED,
|
||||||
|
SET_PROVIDER_STATE
|
||||||
|
} from '../actions/mount_actions';
|
||||||
|
|
||||||
const providerState = Constants.PROVIDER_LIST.map(provider=> {
|
const providerState = Constants.PROVIDER_LIST.map(provider=> {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export const releaseVersionReducer = createReducer({
|
|||||||
Release: 2,
|
Release: 2,
|
||||||
ReleaseUpgradeAvailable: false,
|
ReleaseUpgradeAvailable: false,
|
||||||
UpgradeAvailable: false,
|
UpgradeAvailable: false,
|
||||||
|
UpgradeData: null,
|
||||||
UpgradeDismissed: false,
|
UpgradeDismissed: false,
|
||||||
Version: -1,
|
Version: -1,
|
||||||
VersionLookup: versionLookup,
|
VersionLookup: versionLookup,
|
||||||
|
|||||||
Reference in New Issue
Block a user