Skip to content

Commit b2825bc

Browse files
committed
SciGaPgh-79: Enable user tooltip not to fetch the same user more than once
1 parent 4774825 commit b2825bc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/blocks/block-tooltip-user.vue

+8-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
</template>
1313

1414
<script>
15+
import Vue from 'vue'
1516
import custosStore from "airavata-custos-portal/src/lib/store";
1617
import {custosService} from "airavata-custos-portal/src/lib/store/util/custos.util";
1718
19+
Vue.prototype.userFetchStatus = {};
20+
1821
export default {
1922
name: "block-tooltip-user",
2023
store: custosStore,
@@ -42,9 +45,11 @@ export default {
4245
}
4346
},
4447
methods: {
45-
refreshData() {
46-
if (!this.user) {
47-
this.$store.dispatch("user/fetchUsers", {clientId: custosService.clientId, username: this.username});
48+
async refreshData() {
49+
if (!this.user && !this.userFetchStatus[this.username]) {
50+
this.userFetchStatus[this.username] = "FETCHING";
51+
await this.$store.dispatch("user/fetchUsers", {clientId: custosService.clientId, username: this.username});
52+
this.userFetchStatus[this.username] = "COMPLETED";
4853
}
4954
}
5055
},

0 commit comments

Comments
 (0)