From af646c1999c0510a3a920231eb7e31cb843a023e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 29 Jun 2018 21:52:54 +0200 Subject: [PATCH] Reset FileService status when switching cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/controller/CardController.js | 1 + js/service/FileService.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/controller/CardController.js b/js/controller/CardController.js index 29ce7e9fe..e7904054d 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -43,6 +43,7 @@ app.controller('CardController', function ($scope, $rootScope, $sce, $location, return $state.params; }, function (params) { $scope.params = params; + $scope.fileservice.reset(); }, true); $scope.params = $state.params; diff --git a/js/service/FileService.js b/js/service/FileService.js index 8248debd0..d35dcb15f 100644 --- a/js/service/FileService.js +++ b/js/service/FileService.js @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2018 Julius Härtl +* @copyright Copyright (c) 2018 Julius Härtl * * @author Julius Härtl * @@ -37,6 +37,10 @@ export default class FileService { this.status = null; } + reset () { + this.status = null; + } + runUpload (fileItem, attachmentId) { this.status = null; fileItem.url = OC.generateUrl('/apps/deck/cards/' + fileItem.cardId + '/attachment?type=deck_file'); @@ -117,4 +121,4 @@ export default class FileService { } -app.service('FileService', FileService); \ No newline at end of file +app.service('FileService', FileService);