Loading src/components/JamaResourceTile.vue +29 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ @click="select()" > <v-img v-if="isImageResourceTile()" v-if="isImageResourceTile() && iconLoaded" height="120" :src="resource.urls.m" /> Loading Loading @@ -67,7 +67,8 @@ export default { data() { return { titleLimit: 25 titleLimit: 25, iconLoaded : true, } }, Loading Loading @@ -97,6 +98,14 @@ export default { ...mapGetters(["isPickerMode", "currentResource"]) }, beforeMount() { if(this.isImageResourceTile()){ this.iconLoaded = false; this.fetchTileImage(); } }, methods: { select() { this.$emit('resource-selected', this.resource) Loading Loading @@ -127,8 +136,25 @@ export default { id: this.resource.id, title: this.resource.title, type: 'resource'})); }, async fetchTileImage(){ let maxTrials = 10; const sleep = (ms) => new Promise((r) => setTimeout(r, ms));//test for(let trials = 0; trials < maxTrials; trials++){ console.info('try to fetch img, trial ' + trials); let r = await fetch(this.resource.urls.m); if(r.ok) { this.iconLoaded = true; return; } else await(sleep(2000)); } this.iconLoaded = false; }, } } Loading src/components/VueJama.vue +0 −1 Original line number Diff line number Diff line Loading @@ -766,7 +766,6 @@ export default { reloadCurrentCollection() { this.$store.commit('emptyResources'); console.log("mptified"); this.loadCollectionById(this.currentCollection.id); }, Loading Loading
src/components/JamaResourceTile.vue +29 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ @click="select()" > <v-img v-if="isImageResourceTile()" v-if="isImageResourceTile() && iconLoaded" height="120" :src="resource.urls.m" /> Loading Loading @@ -67,7 +67,8 @@ export default { data() { return { titleLimit: 25 titleLimit: 25, iconLoaded : true, } }, Loading Loading @@ -97,6 +98,14 @@ export default { ...mapGetters(["isPickerMode", "currentResource"]) }, beforeMount() { if(this.isImageResourceTile()){ this.iconLoaded = false; this.fetchTileImage(); } }, methods: { select() { this.$emit('resource-selected', this.resource) Loading Loading @@ -127,8 +136,25 @@ export default { id: this.resource.id, title: this.resource.title, type: 'resource'})); }, async fetchTileImage(){ let maxTrials = 10; const sleep = (ms) => new Promise((r) => setTimeout(r, ms));//test for(let trials = 0; trials < maxTrials; trials++){ console.info('try to fetch img, trial ' + trials); let r = await fetch(this.resource.urls.m); if(r.ok) { this.iconLoaded = true; return; } else await(sleep(2000)); } this.iconLoaded = false; }, } } Loading
src/components/VueJama.vue +0 −1 Original line number Diff line number Diff line Loading @@ -766,7 +766,6 @@ export default { reloadCurrentCollection() { this.$store.commit('emptyResources'); console.log("mptified"); this.loadCollectionById(this.currentCollection.id); }, Loading