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 9c7f733 commit 10d176a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`SharesNavigation component renders a shares navigation for both mobile
<oc-icon-stub name="arrow-down-s" filltype="line" accessiblelabel="" type="span" size="small" variation="passive" color=""></oc-icon-stub>
</oc-button-stub>
<div id="oc-drop-4" class="oc-drop oc-box-shadow-medium oc-rounded">
<div class="oc-card oc-card-body oc-rounded oc-background-secondary oc-p-s">
<div class="oc-card oc-card-body oc-background-secondary oc-p-s">
<ul class="oc-list oc-my-rm oc-mx-rm">
<li>
<oc-button-stub type="router-link" size="medium" to="/files/shares/with-me/" submit="button" variation="passive" appearance="raw" justifycontent="center" gapsize="medium" class="oc-my-xs shares-nav-mobile"><span class="icon-box"><oc-icon-stub name="info" filltype="fill" accessiblelabel="" type="span" size="medium" variation="passive" color=""></oc-icon-stub></span> <span>Shared with me</span></oc-button-stub>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`Spaces projects view should list spaces 1`] = `
<div><button aria-label="Show members" type="button" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw"><span class="oc-icon oc-icon-m oc-icon-passive"><!----></span></button></div>
<div><button aria-label="Show context menu" type="button" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw" id="space-context-btn-1"><span class="oc-icon oc-icon-m oc-icon-passive"><!----></span></button>
<div id="space-context-drop-1" class="oc-drop oc-box-shadow-medium oc-rounded" options="[object Object]">
<div class="oc-card oc-card-body oc-rounded oc-background-secondary oc-p-s">
<div class="oc-card oc-card-body oc-background-secondary oc-p-s">
<div>
<div id="oc-files-context-menu">
<ul id="oc-files-context-actions-members" class="oc-list oc-my-rm oc-mx-rm oc-files-context-actions oc-pb-s oc-files-context-actions-border">
Expand Down

0 comments on commit 10d176a

Please sign in to comment.