Skip to content

[Ags v1] Reactivity problems #666

Answered by Aiz0
Aworldc asked this question in Q&A
Jan 10, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

since both launcher_open and systray_open start as false there is no way to toggle the values
since they both require the other one to be true to be set to true.

heres a fixed version of the functions

export function toggle_launcher(launcher_open, systray_open) {
  launcher_open.value = !launcher_open.value; // toggle value
  systray_open.value = false;
}

export function toggle_systray(launcher_open, systray_open) {
  systray_open.value = !systray_open.value;
  launcher_open.value = false;
}

unless you need to do something more in these functions you could remove one of them and instead switch up the order you pass the variables

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Aworldc
Comment options

Answer selected by Aworldc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants