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

Plugin settings manager should return default value #6660

Open
kontrollanten opened this issue Oct 8, 2024 · 2 comments
Open

Plugin settings manager should return default value #6660

kontrollanten opened this issue Oct 8, 2024 · 2 comments
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development good first issue Status: In Progress 🔜 Type: Feature Request ✨

Comments

@kontrollanten
Copy link
Contributor

Describe the current behavior

When running the following code before an admin has filled a value for SETTING_NUMBER_OF_PAGES the value from getSetting will be undefined.

  registerSetting({
    name: SETTING_NUMBER_OF_PAGES,
    label: 'Number of pages',
    default: 5,
    type: 'input'
  });

  const numberOfPages = await settingsManager.getSetting(SETTING_NUMBER_OF_PAGES)

  console.log(numberOfPages); // will be undefined

Steps to reproduce

See above.

Describe the expected behavior

getSetting should return the default value when there's no custom value set.

Additional information

  • PeerTube instance:

    • URL:
    • Version: develop
    • NodeJS version:
    • Ffmpeg version:
  • Browser name, version and platforms on which you could reproduce the bug:

  • Link to browser console log if relevant:

  • Link to server log if relevant (journalctl or /var/www/peertube/storage/logs/):

@Chocobozzz Chocobozzz added Type: Feature Request ✨ good first issue Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development labels Oct 21, 2024
@JelenaDinic
Copy link

I would like to fix this issue. Can you assign it to me?

@Chocobozzz
Copy link
Owner

@JelenaDinic Sure!

@JelenaDinic JelenaDinic removed their assignment Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development good first issue Status: In Progress 🔜 Type: Feature Request ✨
Projects
None yet
Development

No branches or pull requests

3 participants