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

fix: show loading spinner on follow button while fetching account relationship #2667

Merged
merged 2 commits into from
Mar 9, 2024

Conversation

shuuji3
Copy link
Member

@shuuji3 shuuji3 commented Mar 9, 2024

fix #2647

This PR makes the loading spinner shown while loading a follow relationship with an account so that we can avoid showing a different button label from the actual relationship. The difference is noticeable, especially when the loading time is long.

Screen recording

Before

Screen.Recording.2024-03-10.at.1.18.48.2.mp4

After

loading.mp4

Copy link

stackblitz bot commented Mar 9, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Mar 9, 2024

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 570a142
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/65ecaaec7d61e30008961380

Copy link

netlify bot commented Mar 9, 2024

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 570a142
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/65ecaaeccee5270008796aa0
😎 Deploy Preview https://deploy-preview-2667--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shuuji3 shuuji3 changed the title fix: show loading spinner while fetching account relationship fix: show loading spinner on follow button while fetching account relationship Mar 9, 2024
@shuuji3 shuuji3 force-pushed the fix/follow-button-loading-spinner branch from e6fa322 to 30403f7 Compare March 9, 2024 18:13
Comment on lines 16 to 20
const isLoading = ref(false)

watchEffect(() => {
isLoading.value = relationship.value === undefined
})
Copy link
Member

Choose a reason for hiding this comment

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

Could this be rewritten as:

Suggested change
const isLoading = ref(false)
watchEffect(() => {
isLoading.value = relationship.value === undefined
})
const isLoading = computed(() => relationship.value === undefined)

?

Copy link
Member Author

@shuuji3 shuuji3 Mar 9, 2024

Choose a reason for hiding this comment

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

That's correct 👍🏻 and confirmed the change works as expected on local env.

@patak-dev
Copy link
Member

Looks awesome 💯
This is a big improvement

@patak-dev patak-dev added this pull request to the merge queue Mar 9, 2024
Merged via the queue into elk-zone:main with commit 1c8e48b Mar 9, 2024
13 checks passed
@shuuji3 shuuji3 deleted the fix/follow-button-loading-spinner branch March 9, 2024 18:59
maybeanerd pushed a commit to maybeanerd/crab that referenced this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid misleading default "Follow" button label
2 participants