Allow generating random numbers in nick on page load
This commit is contained in:
parent
e957a52e43
commit
906e79f39b
@ -236,6 +236,9 @@ module.exports = {
|
|||||||
//
|
//
|
||||||
// Nick
|
// Nick
|
||||||
//
|
//
|
||||||
|
// Percent sign (%) will be replaced into a random number from 0 to 9.
|
||||||
|
// For example, Guest%%% will become Guest123 on page load.
|
||||||
|
//
|
||||||
// @type string
|
// @type string
|
||||||
// @default "lounge-user"
|
// @default "lounge-user"
|
||||||
//
|
//
|
||||||
|
@ -521,7 +521,7 @@ function getClientConfiguration() {
|
|||||||
config.themes = themes.getAll();
|
config.themes = themes.getAll();
|
||||||
|
|
||||||
if (config.displayNetwork) {
|
if (config.displayNetwork) {
|
||||||
config.defaults = Helper.config.defaults;
|
config.defaults = _.clone(Helper.config.defaults);
|
||||||
} else {
|
} else {
|
||||||
// Only send defaults that are visible on the client
|
// Only send defaults that are visible on the client
|
||||||
config.defaults = _.pick(Helper.config.defaults, [
|
config.defaults = _.pick(Helper.config.defaults, [
|
||||||
@ -533,6 +533,8 @@ function getClientConfiguration() {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.defaults.nick = config.defaults.nick.replace(/%/g, () => Math.floor(Math.random() * 10));
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user