mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #1409] TypeError is returned when logged in #456
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#456
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carlos-ds on GitHub (Jan 3, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1409
When logged in (in my case via Google), clicking on "Send request" returns a type error.
After logging out and making the exact same request, the response is what I expected.
Desktop (please complete the following information):
@carlos-ds commented on GitHub (Jan 3, 2021):
This seems to be pointing at the
if (fb.currentSettings[0].value)(and [1], [2]) statements, where it can't accessvaluesincecurrentSettingsis undefined. Probably because I don't have any settings yet? I'm not familiar with the Firebase internals.As an example from collection.vue on line 134:
I suspect it would be best to change it to:
I have tested this locally and it seems to fix the problem.
** On second thought, abstracting the if-statements into a separate function and then using that in the
writeHistory,writeEnvironmentsandwriteCollectionshelper functions seems like the cleanest option. But perhaps I'm missing something here? If not, then I'd like to open a pull request for this.@AndrewBastin commented on GitHub (Jan 3, 2021):
I can't find a way to replicate this. Is it happening everytime after you login ?
@liyasthomas commented on GitHub (Jan 4, 2021):
@carlos-ds this is exactly due to your Settings being empty. This happened when you don't turn on sync in settings. I liked your suggestion on abstracting if statements of helper functions feel free to open a PR — meanwhile I'll just fix this by checking existence of Settings key as you mentioned in the example.
@liyasthomas commented on GitHub (Jan 4, 2021):
@carlos-ds let me know if this issue still persist. Do a force refresh before testing.
@carlos-ds commented on GitHub (Jan 4, 2021):
@liyasthomas yes, this seems to be fixed now. I'll have a look at abstracting the if-statements next week.