Files
actual/packages/loot-core/src/client/actions/app.ts
Alberto Gasparin e8a62f89a1 Migrate core to TS p3 (#896)
Another batch of `loot-core` migrated.
2023-04-22 20:43:47 -04:00

39 lines
875 B
TypeScript

import { send } from '../../platform/client/fetch';
import * as constants from '../constants';
export function setAppState(state) {
return {
type: constants.SET_APP_STATE,
state,
};
}
export function updateApp() {
return async dispatch => {
global.Actual.applyAppUpdate();
dispatch(setAppState({ updateInfo: null }));
};
}
export function setLastUndoState(undoState) {
return {
type: constants.SET_LAST_UNDO_STATE,
undoState,
};
}
// This is only used in the fake web version where everything runs in
// the browser. It's a way to send a file to the backend to be
// imported into the virtual filesystem.
export function uploadFile(filename, contents) {
return dispatch => {
return send('upload-file-web', { filename, contents });
};
}
export function focused() {
return dispatch => {
return send('app-focused');
};
}