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: bug on checkbox with default=true #3838

Closed
JohnXLivingston opened this issue Mar 6, 2021 · 1 comment
Closed

Plugin settings: bug on checkbox with default=true #3838

JohnXLivingston opened this issue Mar 6, 2021 · 1 comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor

Comments

@JohnXLivingston
Copy link
Contributor

JohnXLivingston commented Mar 6, 2021

Describe the current behavior
In a plugin, if I have a checkbox settings with default value true, it will always be checked when refreshing the settings page.

A user of my plugin https://github.com/JohnXLivingston/peertube-plugin-livechat had the following bug: JohnXLivingston/peertube-plugin-livechat#13

Steps to reproduce:

  1. Install the plugin peertube-plugin-livechat
  2. Go to plugin settings
  3. Uncheck «Chats are only available for local videos.» or «Use builtin ConverseJS»
  4. Refresh the settings page
  5. The checkbox will be checked again

Describe the expected behavior

Checkbox should remain unchecked (default value should not override false, only undefined values)

Additional information

the settings declaration:

registerSetting({
    name: 'chat-use-builtin',
    label: 'Use builtin ConverseJS',
    type: 'input-checkbox',
    default: true,
    private: false,
    descriptionHTML: '...'
  })
  • PeerTube instance:

    • version: 3.0.1
  • Browser name, version and platforms on which you could reproduce the bug: Firefox

@Chocobozzz Chocobozzz added Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development labels Mar 9, 2021
@Chocobozzz
Copy link
Owner

Hi and thanks for the issue. Should be fixed by 253d4ab

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 Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor
Projects
None yet
Development

No branches or pull requests

2 participants