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.
This commit is contained in:
Kaki In 2022-07-26 14:48:03 +02:00
parent 09fd1a5113
commit f9f49b7640
2 changed files with 11 additions and 18 deletions

View file

@ -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 // 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 // this is a breaking SDK change though to make this option mandatory
import {tileClassForEntry as defaultTileClassForEntry} from "./timeline/tiles/index"; import {tileClassForEntry as defaultTileClassForEntry} from "./timeline/tiles/index";
import {RoomStatus} from "../../../matrix/room/common";
export class RoomViewModel extends ViewModel { export class RoomViewModel extends ViewModel {
constructor(options) { constructor(options) {
@ -210,7 +211,7 @@ export class RoomViewModel extends ViewModel {
let roomName = args[0]; let roomName = args[0];
try { try {
const roomId = await this._options.client.session.joinRoom(roomName); 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); this.navigation.push("room", roomId);
} catch (exc) { } catch (exc) {
if ((exc.statusCode ?? exc.status) === 400) { if ((exc.statusCode ?? exc.status) === 400) {
@ -220,7 +221,7 @@ export class RoomViewModel extends ViewModel {
} else if ((exc.statusCode ?? exc.status) === 403) { } else if ((exc.statusCode ?? exc.status) === 403) {
this._sendError = new Error(`/join : you're not invited to join '${roomName}'`); this._sendError = new Error(`/join : you're not invited to join '${roomName}'`);
} else { } else {
this._sendError = new Error("join syntax: /join <room-id>"); this._sendError = exc;
} }
this._timelineError = null; this._timelineError = null;
this.emitChange("error"); this.emitChange("error");

View file

@ -559,32 +559,24 @@ a {
background : none; background : none;
border : none; border : none;
position : relative; position : relative;
border-radius : 5px;
transition: 0.1s all ease-out;
cursor: pointer;
} }
.RoomView_error button:hover { .RoomView_error button:hover {
background : #cfcfcf; 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 { .RoomView_error button:before {
content:""; content:"\274c";
position : absolute; position : absolute;
top : 17px; top : 15px;
left: 10px; left: 10px;
background : red;
width : 20px; width : 20px;
height : 5px; height : 10px;
transform: rotate(45deg); font-size : 10px;
align-self : middle;
} }
.MessageComposer_replyPreview .Timeline_message { .MessageComposer_replyPreview .Timeline_message {