Skip to content

Commit

Permalink
Apply small changes according to code review
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Sep 12, 2022
1 parent 6faedfa commit fe53ea9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ export default defineComponent({
}
this.sharedTime = this.sharedItem.stime
this.sharedParentDir = sharePathParentOrCurrent
this.shareIndicators = getIndicators(this.file, this.sharesTree)
},
immediate: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
</template>

<script lang="ts">
import { computed, defineComponent, unref, watch } from '@vue/composition-api'
import { computed, defineComponent, unref } from '@vue/composition-api'
import FileLinks from './FileLinks.vue'
import FileShares from './FileShares.vue'
import SpaceMembers from './SpaceMembers.vue'
import { mapGetters, mapState } from 'vuex'
import { useDebouncedRef, useStore } from 'web-pkg/src/composables'
import { useStore } from 'web-pkg/src/composables'
import { useIncomingParentShare } from '../../../composables/parentShare'
export default defineComponent({
Expand All @@ -44,22 +44,15 @@ export default defineComponent({
const currentFileOutgoingSharesLoading = computed(
() => store.getters['Files/currentFileOutgoingSharesLoading']
)
const incomingSharesLoading = computed(() => store.state.Files.incomingSharesLoading)
const sharesTreeLoading = computed(() => store.state.Files.sharesTreeLoading)
const sharesLoading = useDebouncedRef(
currentFileOutgoingSharesLoading.value ||
incomingSharesLoading.value ||
sharesTreeLoading.value,
250
const incomingSharesLoading = computed(() => store.getters['Files/incomingSharesLoading'])
const sharesTreeLoading = computed(() => store.getters['Files/sharesTreeLoading'])
const sharesLoading = computed(
() =>
unref(currentFileOutgoingSharesLoading) ||
unref(incomingSharesLoading) ||
unref(sharesTreeLoading)
)
watch([currentFileOutgoingSharesLoading, incomingSharesLoading, sharesTreeLoading], () => {
sharesLoading.value =
currentFileOutgoingSharesLoading.value ||
incomingSharesLoading.value ||
sharesTreeLoading.value
})
return {
...useIncomingParentShare(),
sharesLoading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { clientService } from 'web-pkg/src/services'
export function useIncomingParentShare() {
const store = useStore()
const incomingParentShare = ref(null)
const sharesTree = computed(() => store.state.Files.sharesTree)
const sharesTree = computed(() => store.getters['Files/sharesTree'])

const loadIncomingParentShare = useTask(function* (signal, resource) {
let parentShare
Expand All @@ -20,7 +20,7 @@ export function useIncomingParentShare() {
}

if (resource.shareId) {
const parentShare = yield clientService.owncloudSdk.shares.getShare(resource.shareId)
parentShare = yield clientService.owncloudSdk.shares.getShare(resource.shareId)
if (parentShare) {
incomingParentShare.value = buildShare(parentShare.shareInfo, resource, true)
return
Expand Down

0 comments on commit fe53ea9

Please sign in to comment.