Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/photos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Mors <corentin.mors@dashlane.com>2019-12-26 15:41:34 +0300
committerCorentin Mors <corentin.mors@dashlane.com>2019-12-26 16:11:16 +0300
commit43b00fca0ace149be82415d1bea3dbcda4a63fba (patch)
tree251cadd0cc7dd14e5195a395a936f71d115ab3cc /js/photos.js
parent98bf5e385f35ac3a52c7e2979fafecab17d1ecf6 (diff)
(Bugfix) Reset Timeline before mount
Signed-off-by: Corentin Mors <corentin.mors@dashlane.com>
Diffstat (limited to 'js/photos.js')
-rw-r--r--js/photos.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/photos.js b/js/photos.js
index bd12d5cb..d8d7d4eb 100644
--- a/js/photos.js
+++ b/js/photos.js
@@ -421,7 +421,7 @@ var Ie=function(t){var e=fe.a.CancelToken.source();return{request:function(){var
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */function En(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Mn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){En(o,r,i,a,s,"next",t)}function s(t){En(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var In,Sn,Bn=E({name:"Timeline",components:{EmptyContent:Ce,VirtualGrid:_n},mixins:[bn],props:{loading:{type:Boolean,required:!0},onlyFavorites:{type:Boolean,default:!1}},data:function(){return{cancelRequest:function(){},done:!1,error:null,loadingPage:!1,page:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cn(Object(n),!0).forEach((function(e){Tn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","timeline"]),{fileList:function(){var t=this;return this.timeline.map((function(e){return t.files[e]})).filter((function(t){return!!t}))},isEmpty:function(){return 0===this.fileList.length},chunkedList:function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return xn(Math.ceil(t.length/e)).map((function(n,r){return t.slice(r*e,r*e+e)}))}(this.fileList,this.gridConfig.count)}}),watch:{onlyFavorites:(Sn=Mn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.$emit("update:loading",!0),this.fetchContent();case 3:case"end":return t.stop()}}),t,this)}))),function(){return Sn.apply(this,arguments)})},beforeMount:function(){var t=Mn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.fetchContent();case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),beforeDestroy:function(){this.cancelRequest()},methods:{fetchContent:(In=Mn(regeneratorRuntime.mark((function t(){var e,n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.loadingPage){t.next=2;break}return t.abrupt("return");case 2:return this.cancelRequest("Changed view"),OCA.Viewer.close(),0===this.timeline.length&&this.$emit("update:loading",!0),this.error=null,this.loadingPage=!0,e=Ie(dn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=9,t.next=12,n(this.onlyFavorites,{page:this.page,perPage:5*this.gridConfig.count});case 12:i=t.sent,this.$store.dispatch("updateTimeline",i),this.$store.dispatch("appendFiles",i),i.length===5*this.gridConfig.count?this.page++:(console.debug("We loaded the last page"),this.done=!0),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(9),t.t0.response&&t.t0.response.status&&(404===t.t0.response.status?(this.error=404,setTimeout((function(){o.$router.push({name:o.$route.name})}),3e3)):this.error=t.t0),console.error("Error fetching timeline",t.t0);case 22:return t.prev=22,this.$emit("update:loading",!1),this.loadingPage=!1,t.finish(22);case 26:case"end":return t.stop()}}),t,this,[[9,18,22,26]])}))),function(){return In.apply(this,arguments)}),getProps:function(t){return t},getComponent:function(){return Re},debounceOnBottomReached:tn()((function(){this.onBottomReached()}),1e3),onBottomReached:function(){this.loadingPage||this.done||(console.debug("Loading next page",this.page),this.fetchContent())},resetState:function(){this.$store.dispatch("resetTimeline"),this.done=!1,this.error=null,this.loadingPage=!1,this.page=0,this.page=0}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 404===t.error?n("EmptyContent",{attrs:{"illustration-name":"folder"}},[t._v("\n\t"+t._s(t.t("photos","This folder does not exists"))+"\n")]):t.error?n("EmptyContent",[t._v("\n\t"+t._s(t.t("photos","An error occurred"))+"\n")]):!t.loading&&t.isEmpty?n("EmptyContent",{attrs:{"illustration-name":"empty"}},[t._v("\n\t"+t._s(t.t("photos","No photos in here"))+"\n")]):t.loading?t._e():n("VirtualGrid",{attrs:{component:t.getComponent,list:t.fileList,"loading-page":t.loadingPage,props:t.getProps},on:{bottomReached:t.onBottomReached}})}),[],!1,null,null,null).exports;function On(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}
+ */function En(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Mn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){En(o,r,i,a,s,"next",t)}function s(t){En(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var In,Sn,Bn=E({name:"Timeline",components:{EmptyContent:Ce,VirtualGrid:_n},mixins:[bn],props:{loading:{type:Boolean,required:!0},onlyFavorites:{type:Boolean,default:!1}},data:function(){return{cancelRequest:function(){},done:!1,error:null,loadingPage:!1,page:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cn(Object(n),!0).forEach((function(e){Tn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(ce.c)(["files","timeline"]),{fileList:function(){var t=this;return this.timeline.map((function(e){return t.files[e]})).filter((function(t){return!!t}))},isEmpty:function(){return 0===this.fileList.length},chunkedList:function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return xn(Math.ceil(t.length/e)).map((function(n,r){return t.slice(r*e,r*e+e)}))}(this.fileList,this.gridConfig.count)}}),watch:{onlyFavorites:(Sn=Mn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.$emit("update:loading",!0),this.fetchContent();case 3:case"end":return t.stop()}}),t,this)}))),function(){return Sn.apply(this,arguments)})},beforeMount:function(){var t=Mn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.resetState(),this.fetchContent();case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),beforeDestroy:function(){this.cancelRequest()},methods:{fetchContent:(In=Mn(regeneratorRuntime.mark((function t(){var e,n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.loadingPage){t.next=2;break}return t.abrupt("return");case 2:return this.cancelRequest("Changed view"),OCA.Viewer.close(),0===this.timeline.length&&this.$emit("update:loading",!0),this.error=null,this.loadingPage=!0,e=Ie(dn),n=e.request,r=e.cancel,this.cancelRequest=r,t.prev=9,t.next=12,n(this.onlyFavorites,{page:this.page,perPage:5*this.gridConfig.count});case 12:i=t.sent,this.$store.dispatch("updateTimeline",i),this.$store.dispatch("appendFiles",i),i.length===5*this.gridConfig.count?this.page++:(console.debug("We loaded the last page"),this.done=!0),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(9),t.t0.response&&t.t0.response.status&&(404===t.t0.response.status?(this.error=404,setTimeout((function(){o.$router.push({name:o.$route.name})}),3e3)):this.error=t.t0),console.error("Error fetching timeline",t.t0);case 22:return t.prev=22,this.$emit("update:loading",!1),this.loadingPage=!1,t.finish(22);case 26:case"end":return t.stop()}}),t,this,[[9,18,22,26]])}))),function(){return In.apply(this,arguments)}),getProps:function(t){return t},getComponent:function(){return Re},debounceOnBottomReached:tn()((function(){this.onBottomReached()}),1e3),onBottomReached:function(){this.loadingPage||this.done||(console.debug("Loading next page",this.page),this.fetchContent())},resetState:function(){this.$store.dispatch("resetTimeline"),this.done=!1,this.error=null,this.loadingPage=!1,this.page=0,this.page=0}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 404===t.error?n("EmptyContent",{attrs:{"illustration-name":"folder"}},[t._v("\n\t"+t._s(t.t("photos","This folder does not exists"))+"\n")]):t.error?n("EmptyContent",[t._v("\n\t"+t._s(t.t("photos","An error occurred"))+"\n")]):!t.loading&&t.isEmpty?n("EmptyContent",{attrs:{"illustration-name":"empty"}},[t._v("\n\t"+t._s(t.t("photos","No photos in here"))+"\n")]):t.loading?t._e():n("VirtualGrid",{attrs:{component:t.getComponent,list:t.fileList,"loading-page":t.loadingPage,props:t.getProps},on:{bottomReached:t.onBottomReached}})}),[],!1,null,null,null).exports;function On(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*