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