Skip to content

Conversation

remihuigen
Copy link

Problem

The id ref does not get populated when the component mounts, showing a video interface without a selected video file (even if the component props have an id value)

Solution

Set the responsible watcher immediate prop to true

watch(() => props.value, setServiceAndID, { immediate: true });

function setServiceAndID() {
  if (!props.value) return;

  service.value = props.value.service;

  if (service.value === 'directus') {
    fileID.value = props.value.id;
    return;
  }

  id.value = props.value.id;
}

NOT: this exact behavior is already present in the audio-interface

By setting the watcher to immediate, the id and service refs are populated when the components mount
@remihuigen remihuigen changed the title fix: setServiceAdnID watcher as immediate fix: setServiceAndID watcher as immediate Aug 13, 2025
@remihuigen remihuigen closed this Aug 18, 2025
@remihuigen remihuigen reopened this Aug 20, 2025
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.

1 participant