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 booking link toggle in schedule creation #697

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

devmount
Copy link
Collaborator

Description of the Change

  • Booking confirmation is now properly handled via schedule input object. This fixes a bug where a direct call on the retrieved schedule object happend on null.
  • The SwitchToggle component now handles state changes from the parent. This sometimes happens during initialization when waiting for async data.

Applicable Issues

Fixes #695

Copy link
Member

@MelissaAutumn MelissaAutumn left a comment

Choose a reason for hiding this comment

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

Looks good, one suggestion though!

() => {
state.value = props.active;
}
);
Copy link
Member

Choose a reason for hiding this comment

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

I think you might be able to {active} = toRef(props) instead of this.

Copy link
Collaborator Author

@devmount devmount Sep 27, 2024

Choose a reason for hiding this comment

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

Actually I tried const state = toRef(props.active); but it won't properly initialize state on page load (it uses the default value instead of the parents prop when i async loaded everything)... 😅 Or I'm just to stupid to properly implement this 😂 Maybe I oversaw sth?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I think you need to toRef props itself and destructing assign active.

so { active } = toRef(props);

but i can take a look on tuesday!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, you mean toRefs() (with an 's')? OR actually toRef()? I tried the former too but it complained about being read-only when updating that ref 😂

Copy link
Member

Choose a reason for hiding this comment

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

This works for now 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

haha alright! thanks

@MelissaAutumn MelissaAutumn merged commit 6bb9594 into main Oct 1, 2024
4 checks passed
@MelissaAutumn MelissaAutumn deleted the bugs/695-fix-booking-confirmation branch October 1, 2024 15:14
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.

After removing one google account and adding another my schedule is "turned off"
2 participants