Added better auto-update handling. RPS-17
This commit is contained in:
@@ -48,3 +48,7 @@ export const setUpdateAvailable = (available) => ({
|
||||
type: ApplicationActionTypes.SET_UPDATE_AVAILABLE,
|
||||
payload: available,
|
||||
});
|
||||
export const setUpdateProgress = (progress) => ({
|
||||
type: ApplicationActionTypes.SET_UPDATE_PROGRESS,
|
||||
payload: progress,
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ const INITIAL_STATE = {
|
||||
selectedJobTargetPc: 0,
|
||||
settings: {},
|
||||
updateAvailable: false,
|
||||
updateProgress: null,
|
||||
};
|
||||
|
||||
const { ipcRenderer } = window;
|
||||
@@ -63,6 +64,8 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
|
||||
return { ...state, settings: { ...state.settings, ...action.payload } };
|
||||
case ApplicationActionTypes.SET_UPDATE_AVAILABLE:
|
||||
return { ...state, updateAvailable: action.payload };
|
||||
case ApplicationActionTypes.SET_UPDATE_PROGRESS:
|
||||
return { ...state, updateProgress: action.payload };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -36,3 +36,7 @@ export const selectUpdateAvailable = createSelector(
|
||||
[selectApplication],
|
||||
(application) => application.updateAvailable
|
||||
);
|
||||
export const selectUpdateProgress = createSelector(
|
||||
[selectApplication],
|
||||
(application) => application.updateProgress
|
||||
);
|
||||
|
||||
@@ -9,5 +9,7 @@ const ApplicationActionTypes = {
|
||||
SET_SELECTED_JOB_TARGET_PC_SUCCESS: "SET_SELECTED_JOB_TARGET_PC_SUCCESS",
|
||||
SET_SETTINGS: "SET_SETTINGS",
|
||||
SET_UPDATE_AVAILABLE: "SET_UPDATE_AVAILABLE",
|
||||
SET_UPDATE_PROGRESS: "SET_UPDATE_PROGRESS",
|
||||
|
||||
};
|
||||
export default ApplicationActionTypes;
|
||||
|
||||
@@ -128,6 +128,7 @@ export function* signInSuccessSaga({ payload }) {
|
||||
LogRocket.identify(payload.email, {
|
||||
email: payload.email,
|
||||
});
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.checkForUpdates);
|
||||
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
event: "SIGN_IN_SUCCESS",
|
||||
|
||||
Reference in New Issue
Block a user