From f9f49b76403482ef657d7e2638660c4d3c48ca8e Mon Sep 17 00:00:00 2001 From: Kaki In <91763754+Kaki-In@users.noreply.github.com> Date: Tue, 26 Jul 2022 14:48:03 +0200 Subject: [PATCH] Fixed an error and improving css If the /join command success, an error was thrown, because of a copy-pasted command not well integrated The button of the error on "theme.css" contains now an unicode cross. The :after/:before cross was disformed when opening the room informations. --- src/domain/session/room/RoomViewModel.js | 5 ++-- .../web/ui/css/themes/element/theme.css | 24 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index a1939f75..039996cd 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -23,6 +23,7 @@ import {imageToInfo} from "../common.js"; // TODO: remove fallback so default isn't included in bundle for SDK users that have their custom tileClassForEntry // this is a breaking SDK change though to make this option mandatory import {tileClassForEntry as defaultTileClassForEntry} from "./timeline/tiles/index"; +import {RoomStatus} from "../../../matrix/room/common"; export class RoomViewModel extends ViewModel { constructor(options) { @@ -210,7 +211,7 @@ export class RoomViewModel extends ViewModel { let roomName = args[0]; try { const roomId = await this._options.client.session.joinRoom(roomName); - await session.observeRoomStatus(roomId).waitFor(status === RoomStatus.Joined); + await (await this._options.client.session.observeRoomStatus(roomId)).waitFor(status => status === RoomStatus.Joined); this.navigation.push("room", roomId); } catch (exc) { if ((exc.statusCode ?? exc.status) === 400) { @@ -220,7 +221,7 @@ export class RoomViewModel extends ViewModel { } else if ((exc.statusCode ?? exc.status) === 403) { this._sendError = new Error(`/join : you're not invited to join '${roomName}'`); } else { - this._sendError = new Error("join syntax: /join "); + this._sendError = exc; } this._timelineError = null; this.emitChange("error"); diff --git a/src/platform/web/ui/css/themes/element/theme.css b/src/platform/web/ui/css/themes/element/theme.css index f611c767..0f40bdf3 100644 --- a/src/platform/web/ui/css/themes/element/theme.css +++ b/src/platform/web/ui/css/themes/element/theme.css @@ -559,32 +559,24 @@ a { background : none; border : none; position : relative; + border-radius : 5px; + transition: 0.1s all ease-out; + cursor: pointer; } .RoomView_error button:hover { background : #cfcfcf; } -.RoomView_error button:after { - content:""; - position : absolute; - top : 10px; - right: 16px; - background : red; - width : 5px; - height : 20px; - transform: rotate(45deg); -} - .RoomView_error button:before { - content:""; + content:"\274c"; position : absolute; - top : 17px; + top : 15px; left: 10px; - background : red; width : 20px; - height : 5px; - transform: rotate(45deg); + height : 10px; + font-size : 10px; + align-self : middle; } .MessageComposer_replyPreview .Timeline_message {