Skip to content

Fix deleting multiple user w-o reloading - #296

Closed
eMerzh wants to merge 1 commit into
owncloud:stable45from
eMerzh:fix_multiple_del_user
Closed

eMerzh wants to merge 1 commit into
owncloud:stable45from
eMerzh:fix_multiple_del_user

Conversation

@eMerzh

@eMerzh eMerzh commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

When you delete a user,
as in file, oc put you an undo message. (nice btw)
and it do the task only when we leave the page.

so , when you delete 2+ users in row, oc will only delete the last one.

my patch empty the queue when we want to delete another user.
so there is always 1 user top in the delete queue as it was meant to be.

We may want to apply this in master as well.

@ghost

ghost commented Nov 6, 2012

Copy link
Copy Markdown

Can one of the admins verify this patch?

@blizzz

blizzz commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

👍
don't forget to bring this to master, too

@VicDeo

VicDeo commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

@tanghus +1.
undefined is a raw type, not string while typeof returns string. http://www.w3resource.com/javascript/operators/typeof.php

But given that a has been not defined:
typeof a!==undefined evaluates to 'true'
typeof a!=='undefined' evaluates to 'false'

typeof undefined evaluates to 'undefined' since it's just an uninitialized variable in this context ;)

@tanghus

tanghus commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

JS is fun, typeof NaN === "number" :-P

@VicDeo

VicDeo commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

@tanghus actually I agreed with you :)
undefined is a raw type, not string while typeof returns string.

But from the other hand it's not possible to use strict comparison "at least" in this case. You see, the examples above show completely different results

PS NaN is a number that is not equal to itself or any other number by specification.
http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.23

@tanghus

tanghus commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

actually I agreed with you :)

Of course, or I'll revoke your push privileges ;)

http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.23

Just proves to show that standardization committees have far too much time on their hands ;)

Sorry, couldn't helpt it, but seriously typeof returns a comparable string value, so it should be appropriate to use strict comparison, but you're right that it should be either that or might as well be if(UserList.deleteUid) - or do I misunderstand you?

@VicDeo

VicDeo commented Nov 6, 2012

Copy link
Copy Markdown
Contributor

@tanghus I meant that quotes are more important than check for type equality in this particular case.

Any of
if (typeof UserList.deleteUid !== 'undefined') {
if (typeof UserList.deleteUid != 'undefined') {
is acceptable
but none of
if (typeof UserList.deleteUid != undefined) {
if (typeof UserList.deleteUid !== undefined) {

As soon as UserList is object
if(UserList.deleteUid) {
will also work. But I'd prefer to initialize it with null explicitly in this case.

PS trick = 42; typeof trick.doTheTrick

@eMerzh

eMerzh commented Nov 7, 2012

Copy link
Copy Markdown
Contributor Author

I've created a new PR with the correct commit :)
you can move your discussion about JS there 💬 :D

#312

i close this one

@eMerzh eMerzh closed this Nov 7, 2012
@eMerzh eMerzh mentioned this pull request Nov 11, 2012
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants