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 ocis-1043 #4444

Merged
merged 5 commits into from
Dec 11, 2020
Merged

fix ocis-1043 #4444

merged 5 commits into from
Dec 11, 2020

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Dec 9, 2020

partially fixes: owncloud/ocis#1043
fixes: owncloud/ocis#884

@fschade fschade requested a review from LukasHirt December 9, 2020 17:03
Copy link
Collaborator

@LukasHirt LukasHirt left a comment

Choose a reason for hiding this comment

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

I guess cloning the whole items instead of one by one wouldn't make a real difference here with performance, right? Since I guess there won't ever be hundreds of nav items 🤷

show loading screen while waiting for all required data from backend
check for route path instead of name in ADD_NAV_ITEM
fix session persist and add only what is required
@fschade
Copy link
Contributor Author

fschade commented Dec 10, 2020

I guess cloning the whole items instead of one by one wouldn't make a real difference here with performance, right? Since I guess there won't ever be hundreds of nav items 🤷

@LukasHirt, yes its more costy to do it one by one (but not much it's a low level api). The problem if we do

const o = [1, 2, 3]
const n = [...o]
n[0] = 99

the result would for n be [99,2,3] and o is still [1, 2, 3]

but if we do

const o = [{foo: 1}]
const n = [...o]
n[0].foo = 99

we will mutate the original object in o

objects in arrays get refferenced and not deep copied.

src/Phoenix.vue Outdated
}"
uk-height-viewport
>
<oc-spinner size="xxxlarge" :aria-label="$gettext('Loading')" class="uk-position-center" />
Copy link
Member

Choose a reason for hiding this comment

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

From my personal feeling the spinner is too big. I would choose xlarge size and border sizes in the css class 10px.

src/store/user.js Show resolved Hide resolved
@@ -32,7 +32,9 @@ const mutations = {
ADD_NAV_ITEM(state, { extension, navItem }) {
const dynamicNavItems = { ...state.dynamicNavItems }
dynamicNavItems[extension] = dynamicNavItems[extension] || []
const index = dynamicNavItems[extension].findIndex(item => item.name === navItem.name)
const index = dynamicNavItems[extension].findIndex(
item => item.route.path === navItem.route.path
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for spotting this ❤️

@fschade fschade requested a review from kulmann December 11, 2020 11:46
Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

👍

@fschade fschade merged commit 1d73049 into master Dec 11, 2020
@delete-merged-branch delete-merged-branch bot deleted the bugfix-ocis-1043 branch December 11, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants