Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Disabled/enabled status does not change on update. #55

Closed
DamnedScholar opened this issue Jun 15, 2016 · 8 comments
Closed

Disabled/enabled status does not change on update. #55

DamnedScholar opened this issue Jun 15, 2016 · 8 comments

Comments

@DamnedScholar
Copy link
Contributor

When you add a project without a path, it is added as disabled (styled in dark grey, with a strikethrough, and a cursor that turns into a "do not enter" sign). If you then update the project and add a path, it continues to be disabled. Reloading the window will fix this (changing the state of the project to what it should be). This behavior also happens in reverse (so a project whose path has been removed does not become disabled until the package is re-initialized).

@DamnedScholar
Copy link
Contributor Author

list-item-component.js (where validate() resides) can't be required in utilities.js because it invokes functions that (at that point) haven't been declared yet and the compiler balks.

Not sure whether it would be more effective to re-create validate() inside updateItem() (and suck up the duplication) or have the if (changes.paths) block send a signal that tells the sidebar to rerun validate() when an item is updated. Probably the latter.

@jccguimaraes
Copy link
Owner

jccguimaraes commented Jun 15, 2016

Thanks for reporting this. Your feedback is being awesome

@jccguimaraes
Copy link
Owner

fixed :)

@DamnedScholar
Copy link
Contributor Author

Works perfectly. Thanks. :)

@DamnedScholar
Copy link
Contributor Author

The simplicity of the solution is pleasantly surprising. I feel like my JS noobishness is showing through, because I didn't notice that itemView was capable of that. Now I know.

@jccguimaraes
Copy link
Owner

why do you say that? Do you know how much time it took me to fix this? "if (changes.paths) block send a signal that tells the sidebar to rerun validate() when an item is updated" you just pointed me to the right direction. You were capable of interpreting someone else's code and for me that's the most challenging part of being a developer, and this is JS.... :) so cheer up mate!

@DamnedScholar
Copy link
Contributor Author

I say that because I was convinced that itemView just referred to the item itself and I didn't make the connection that it would also have access to the list item methods like validate().

Interpreting code is easy as long as variable and function names are human-readable. I've always been able to take known vocabulary in unknown logical patterns and translate into whatever native pseudocode my brain thinks in. Sometimes it takes a lot of time iterations and following code back and forth across multiple files.

I don't mean to come off as if I'm mopey or putting myself down. I'm just rambling. I tend to over-explain things sometimes.

@jccguimaraes
Copy link
Owner

:D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants