From a920914b4c058c59883e24ebda39fb0717f92fd2 Mon Sep 17 00:00:00 2001 From: Simon Ser <contact@emersion.fr> Date: Sat, 9 Oct 2021 10:17:52 +0200 Subject: [PATCH] Add nick to config.json --- README.md | 2 ++ components/app.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 909e5a3..732743a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ gamja default settings can be set using a `config.json` file at the root: // require it, and "disabled" to never ask for a password. Defaults to // "optional". "auth": "optional", + // Default nickname (string). + "nick": "asdf", // Don't display the login UI, immediately connect to the server // (boolean). "autoconnect": true, diff --git a/components/app.js b/components/app.js index d4fbb84..b5f7f66 100644 --- a/components/app.js +++ b/components/app.js @@ -201,6 +201,9 @@ export default class App extends Component { } else if (typeof config.server.autojoin === "string") { connectParams.autojoin = [config.server.autojoin]; } + if (typeof config.server.nick === "string") { + connectParams.nick = config.server.nick; + } if (typeof config.server.autoconnect === "boolean") { connectParams.autoconnect = config.server.autoconnect; }