diff --git a/.env b/.env index 2c66fea..4cd23ca 100644 --- a/.env +++ b/.env @@ -19,7 +19,7 @@ APP_ENV=dev APP_SECRET=EDIT_ME ###< symfony/framework-bundle ### -APP_VERSION=1.12.1 +APP_VERSION=1.13.0 APP_NAME=KevaChat @@ -57,13 +57,13 @@ APP_KEVACOIN_MINE_SOLO_URL=https://kevacoin.org/tutorial_solo_mining.html APP_KEVACOIN_EXPLORER_URL=https://keva.one/explorer/address/ # Pinned room namespaces, separated with | -APP_KEVACOIN_ROOM_NAMESPACES_PINNED=EDIT_ME +APP_KEVACOIN_ROOM_NAMESPACES_PINNED= # Allowed room namespaces for read only (e.g. project news) separated with | APP_KEVACOIN_ROOM_NAMESPACES_READONLY= # Redirect from index page to default room -APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT=EDIT_ME +APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT= # Session expire APP_SESSION_DEFAULT_TIMEOUT=2592000 diff --git a/README.md b/README.md index 6fda003..321f00a 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Application package contain settings preset, just few steps required to launch: * Send few coins to this address and wait for new block to continue * To allow users registration, create namespace `kevacoin-cli keva_namespace "_KEVACHAT_USERS_"` * Create at least one room namespace with Web UI or CLI `kevacoin-cli keva_namespace "sandbox"` -* Provide at least one namespace for default chat room to `env`.`APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT` (for homepage redirects) +* Optionally, provide namespace for default chat room at `env`.`APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT` (for homepage redirect) ## Contribution diff --git a/src/Controller/RoomController.php b/src/Controller/RoomController.php index be45d2e..e14246c 100644 --- a/src/Controller/RoomController.php +++ b/src/Controller/RoomController.php @@ -29,12 +29,21 @@ class RoomController extends AbstractController ?Request $request ): Response { - return $this->redirectToRoute( - 'room_namespace', - [ - 'namespace' => $request->get('namespace') ? $request->get('namespace') : $this->getParameter('app.kevacoin.room.namespace.default'), - '_fragment' => 'latest' - ] + // Redirect to default room on defined + if ($this->getParameter('app.kevacoin.room.namespace.default')) + { + return $this->redirectToRoute( + 'room_namespace', + [ + 'namespace' => $request->get('namespace') ? $request->get('namespace') : $this->getParameter('app.kevacoin.room.namespace.default'), + '_fragment' => 'latest' + ] + ); + } + + // Return room list by default + return $this->list( + $request ); } diff --git a/templates/default/module/rooms.html.twig b/templates/default/module/rooms.html.twig index 3d4d5d5..812ce1b 100644 --- a/templates/default/module/rooms.html.twig +++ b/templates/default/module/rooms.html.twig @@ -23,7 +23,7 @@ {% endif %}