Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indirect link toggling #8308

Merged
merged 3 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions changelog/unreleased/change-update-vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Change: Update Vue to v3.2.45 (via compat mode)
Change: Update Vue to v3.2

Vue has been updated to v3.2.45. It is currently running in the so-called "compat mode", which guarantees compatibility with Vue 2.7. More detailed information can be found in the referenced issues and PRs down below.
Vue has been updated to v3.2. More detailed information can be found in the referenced issues and PRs down below.

BREAKING CHANGE for developers: The `vue/composition-api` plugin is not available anymore as the composition-api now comes with Vue.

https://github.com/owncloud/web/issues/7948
https://github.com/owncloud/web/issues/5269
https://github.com/owncloud/web/issues/8283
https://github.com/owncloud/web/issues/8307
https://github.com/owncloud/web/pull/8128
https://github.com/owncloud/web/pull/7877
https://github.com/owncloud/web/pull/8207
Expand All @@ -23,3 +25,4 @@ https://github.com/owncloud/web/pull/8289
https://github.com/owncloud/web/pull/8287
https://github.com/owncloud/web/pull/8285
https://github.com/owncloud/web/pull/8288
https://github.com/owncloud/web/pull/8308
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</div>
</template>
<script lang="ts">
import { ComputedRef, defineComponent, inject, PropType } from 'vue'
import { ComputedRef, defineComponent, inject, PropType, ref } from 'vue'
import { DateTime } from 'luxon'
import { mapGetters, mapActions, mapState, mapMutations } from 'vuex'
import {
Expand Down Expand Up @@ -155,8 +155,9 @@ export default defineComponent({
const store = useStore()

const linkListCollapsed = !store.getters.configuration.options.sidebar.shares.showAllOnLoad
const indirectLinkListCollapsed =
const indirectLinkListCollapsed = ref(
!store.getters.configuration.options.sidebar.shares.showAllOnLoad
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really work? Just wrapping a value in ref() shouldn't make it reactive I thought, doesnt this need to be wrapped in computed()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, yes. My idea was to make it mutable, because it needs to be written. showAllOnLoad is just the initial value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds legit @JammingBen we indeed don't want to mutate the config option in the store. using it as initial value and not persist the change in memory is a good solution. well spotted though @dschmidt I also had the same raised eyebrow feeling.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, one idea for improvement though:

Suggested change
)
const indirectLinkListCollapsed = ref(linkListeCollapsed)

Otherwise you have the same store reference twice in consecutive lines.


return {
...useGraphClient(),
Expand Down Expand Up @@ -288,8 +289,7 @@ export default defineComponent({
return this.currentFileOutgoingLinks
.filter((link) => !link.quicklink)
.map((share) => {
share.key = 'direct-link-' + share.id
return share
return { ...share, key: 'direct-link-' + share.id }
})
.sort((a, b) => {
return b.stime - a.stime
Expand Down