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

intro-to-solana-mobile.md - refactor: optimize counter increment logic and notification handling #355

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

EmekaManuel
Copy link
Contributor

Problem

  • The showToastOrAlert function name was unclear, and error handling in async functions was inconsistent.
  • The logic for balance checks and airdrop requests during transactions needed improvements.
  • Detailed error logging and cleanup were required for better readability and maintainability.

Summary of Changes

Refactored showToastOrAlert to showNotification for better clarity.
Improved async/await usage with consistent error handling using try/catch.
Added detailed logging for missing program or counterAddress.
Cleaned up and grouped logic for better readability and maintainability.
Ensured balance checks and airdrop requests are well-handled during transactions.

- Refactored showToastOrAlert to showNotification  for better clarity.
- Improved async/await usage with consistent error handling using try/catch.
- Added detailed logging for missing program or counterAddress.
- Cleaned up and grouped logic for better readability and maintainability.
- Ensured balance checks and airdrop requests are well-handled during transactions.
@mikemaccana mikemaccana added the good first issue Good for newcomers label Aug 27, 2024
@mikemaccana mikemaccana changed the title refactor: optimize counter increment logic and notification handling intro-to-solana-mobile.md - refactor: optimize counter increment logic and notification handling Aug 27, 2024
@mikemaccana
Copy link
Collaborator

Thanks! Needs a little work but we can get this in once done.

@mikemaccana mikemaccana added superteam-lesson-updates and removed good first issue Good for newcomers labels Aug 27, 2024
@EmekaManuel
Copy link
Contributor Author

Thanks! Needs a little work but we can get this in once done.

Thank you Mike! Looking forward to that.

Copy link
Collaborator

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Some small changes needed but also not many.

content/courses/mobile/intro-to-solana-mobile.md Outdated Show resolved Hide resolved
content/courses/mobile/intro-to-solana-mobile.md Outdated Show resolved Hide resolved
} else {
Alert.alert(message);
}
const showNotification = (message: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This does not show notifications.

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 does show notification. can you please elaborate on this review

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it create one of these?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It creates these instead:
alert_example_ios
alert_example_android

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's not a 'notification' then. The word notification has a very specific meaning on mobile. Please change the function name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to showMessage()

Copy link
Collaborator

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Just one last bit and we can get this in.

Copy link
Collaborator

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Just need to fix function name per above. showMessage() would be fine. Just not 'notification'.

@EmekaManuel
Copy link
Contributor Author

Just need to fix function name per above. showMessage() would be fine. Just not 'notification'.

changed to showMessage✅

Copy link

github-actions bot commented Dec 3, 2024

This pull request has been automatically marked as stale because it has not had recent activity. Remove stale label or comment or this will be closed in 7 days.

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

Successfully merging this pull request may close these issues.

2 participants