2020-07-10 23:09:37 -07:00
|
|
|
import { action, Action } from 'easy-peasy';
|
2020-04-10 13:57:24 -07:00
|
|
|
import { cleanDirectoryPath } from '@/helpers';
|
2019-08-04 14:58:31 -07:00
|
|
|
|
|
|
|
export interface ServerFileStore {
|
|
|
|
directory: string;
|
|
|
|
setDirectory: Action<ServerFileStore, string>;
|
|
|
|
}
|
|
|
|
|
|
|
|
const files: ServerFileStore = {
|
2019-08-05 21:52:48 -07:00
|
|
|
directory: '/',
|
2019-08-04 14:58:31 -07:00
|
|
|
|
|
|
|
setDirectory: action((state, payload) => {
|
2020-06-13 09:49:32 -07:00
|
|
|
state.directory = cleanDirectoryPath(payload);
|
2019-08-04 14:58:31 -07:00
|
|
|
}),
|
|
|
|
};
|
|
|
|
|
|
|
|
export default files;
|