Plugin settings manager should return default value
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 (
journalctlor/var/www/peertube/storage/logs/):
I would like to fix this issue. Can you assign it to me?
@JelenaDinic Sure!
@Chocobozzz could you assign this to me?
Done!
Hi. I'm new to open source. I'd like to work on it.