-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
SetNodePicture: Refactor 'handleImageTap' #2100
Conversation
views/Settings/SetNodePicture.tsx
Outdated
@@ -125,35 +125,14 @@ export default class SetNodePicture extends React.Component< | |||
); | |||
}; | |||
|
|||
getPhoto(photo: string | null): string { | |||
getPhoto(photo: string | null): object | string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it necessary to change the structure of the getPhoto
calls? Seems like we could have just removed handleImageTap
and made the change on line 194
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did that coz we needed the object to return with the key uri
in line 131, to fetch gallery imported photos
This approach doesn't work. Images are lost on reload |
What if we refactor
|
yup we can do that |
59a00ba
to
478a0f3
Compare
Holds up against Android upgrades. About to test iOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not hold up on iOS, I believe the file paths change every upgrade.
We'll have to emulate what we do on custom images and save a copy of the image that we point to.
The file storage is working correctly now, however the approach isn't quite right. We are unnecessarily creating new copies of each image every time we tap it. The 'download' event should only trigger once the |
eead25b
to
20841b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passing all my tests. nice work
No description provided.