Refactor: Remove Console Log and Enhance DatabaseURL Configuration - Fixes#998 #1001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In this pull request, I removed the console.log(country) line for improved code cleanliness. Additionally, I edited the databaseURL property in the configuration to use the import.meta.env.VITE_APP_DATABASE_URL variable instead of constructing the URL inline. The updated line now reads:
databaseURL: import.meta.env.VITE_APP_DATABASE_URL,
Related Issue
Fixes #998
Motivation and Context
The removal of console.log(country) enhances the codebase by eliminating unnecessary logging. The modification to the databaseURL property allows for more flexibility and maintainability by utilizing an environment variable (VITE_APP_DATABASE_URL) instead of hardcoding the URL. (Earlier it was hardcoded to only work for databases in US central region 'https://DATABASE_NAME.firebaseio.com')
How Has This Been Tested?
I have tested these changes in a local development environment. Specifically, I performed the following tests:
Checked that the console.log(country) line was successfully removed without affecting the functionality.
Verified that the updated databaseURL configuration works correctly with the specified environment variable.
Screenshots or GIF (In Case of UI Changes):
Screencast from 2024-01-01 14-05-45.webm
Types of Changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[x] Other (please specify): Code cleanup and configuration enhancement
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[x] All new and existing tests passed.