From 06efee11437821ddb6f79e206bcbcd05111ca604 Mon Sep 17 00:00:00 2001 From: irismarie Date: Thu, 11 Feb 2021 14:31:00 +0100 Subject: [PATCH] remove files from FileStore after result is deleted --- src/result/result-store.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/result/result-store.js b/src/result/result-store.js index 519c94a..5d93d38 100644 --- a/src/result/result-store.js +++ b/src/result/result-store.js @@ -17,6 +17,7 @@ import ArrayStore from '../common/array-store'; import ResultsDataManager from './results-data-manager'; +import AppDispatcher from '../common/app-dispatcher'; class ResultStore extends ArrayStore { constructor() { @@ -56,6 +57,16 @@ class ResultStore extends ArrayStore { this.simplifyTimestamps([action.data]); return super.reduce(state, action); + case 'results/removed': + // Remove files from filestore + action.data.resultFileIDs.forEach(fileid => { + AppDispatcher.dispatch({ + type: 'files/removed', + data: fileid + }); + }); + return super.reduce(state, action); + case 'resultfiles/start-upload': ResultsDataManager.uploadFile(action.data, action.resultID, action.token, action.progressCallback, action.finishedCallback, action.scenarioID); return state;