|
|
@ -13,6 +13,8 @@ import { set, update } from './baseActions';
|
|
|
|
|
|
|
|
|
|
|
|
export const section = 'interactiveImport';
|
|
|
|
export const section = 'interactiveImport';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MAXIMUM_RECENT_FOLDERS = 10;
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// State
|
|
|
|
// State
|
|
|
|
|
|
|
|
|
|
|
@ -155,12 +157,14 @@ export const reducers = createHandleActions({
|
|
|
|
const index = recentFolders.findIndex((r) => r.folder === folder);
|
|
|
|
const index = recentFolders.findIndex((r) => r.folder === folder);
|
|
|
|
|
|
|
|
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
recentFolders.splice(index, 1, recentFolder);
|
|
|
|
recentFolders.splice(index, 1);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
recentFolders.push(recentFolder);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Object.assign({}, state, { recentFolders });
|
|
|
|
recentFolders.push(recentFolder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sliceIndex = Math.max(recentFolders.length - MAXIMUM_RECENT_FOLDERS, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Object.assign({}, state, { recentFolders: recentFolders.slice(sliceIndex) });
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
[REMOVE_RECENT_FOLDER]: function(state, { payload }) {
|
|
|
|
[REMOVE_RECENT_FOLDER]: function(state, { payload }) {
|
|
|
|