diff --git a/src/client/webapp/preload.ts b/src/client/webapp/preload.ts
index 6c5b920..53cdfe6 100644
--- a/src/client/webapp/preload.ts
+++ b/src/client/webapp/preload.ts
@@ -18,7 +18,6 @@ import { Changes, Channel, ConnectionInfo, GuildMetadata, Member, Resource, Toke
import Q from './q-module';
import bindWindowButtonEvents from './elements/events-window-buttons';
import bindTextInputEvents from './elements/events-text-input';
-import bindConnectionEvents from './elements/events-connection';
import bindAddGuildTitleEvents from './elements/events-guild-title';
import bindAddGuildEvents from './elements/events-add-guild';
import PersonalDB from './personal-db';
@@ -74,7 +73,6 @@ window.addEventListener('DOMContentLoaded', () => {
bindWindowButtonEvents(q);
bindTextInputEvents(document, q, ui);
- bindConnectionEvents(document, q, ui);
bindAddGuildTitleEvents(document, q, ui);
bindAddGuildEvents(document, q, ui, guildsManager);
diff --git a/src/client/webapp/styles/connection.scss b/src/client/webapp/styles/connection.scss
index 65d3e1c..f9b4441 100644
--- a/src/client/webapp/styles/connection.scss
+++ b/src/client/webapp/styles/connection.scss
@@ -1,23 +1,16 @@
@import "theme.scss";
-#connection.hidden {
- visibility: hidden;
-}
-
-#connection.member {
+.connection-info {
background-color: $background-secondary-alt;
padding: 8px;
cursor: pointer; /* clicking on this brings up the select-status context menu */
-}
-#connection.member .name {
- width: calc(224px - 40px);
-}
+ .name {
+ width: calc(224px - 40px);
+ font-weight: 600;
+ }
-#member-name.name {
- font-weight: 600;
-}
-
-#member-status-circle.status-circle {
- border-color: $background-secondary-alt;
+ .status-circle {
+ border-color: $background-secondary-alt;
+ }
}
diff --git a/src/client/webapp/styles/contexts.scss b/src/client/webapp/styles/contexts.scss
index a29527d..98e020b 100644
--- a/src/client/webapp/styles/contexts.scss
+++ b/src/client/webapp/styles/contexts.scss
@@ -5,6 +5,12 @@
.context {
position: fixed;
+ // Since useEffect gets called after the element is rendered, hide it until
+ // it gets aligned
+ &.react:not(.aligned) {
+ visibility: hidden;
+ }
+
.menu {
min-width: 180px;
box-sizing: border-box;
diff --git a/src/client/webapp/ui.ts b/src/client/webapp/ui.ts
index b1bab91..8e4146b 100644
--- a/src/client/webapp/ui.ts
+++ b/src/client/webapp/ui.ts
@@ -137,26 +137,10 @@ export default class UI {
await this.lockConnection(guild, () => {
this.activeConnection = connection;
- this.q.$('#connection').className = 'member ' + connection.status;
- this.q.$('#member-name').innerText = connection.displayName;
- this.q.$('#member-status-text').innerText = connection.status;
-
this.q.$('#guild').className = '';
for (const privilege of connection.privileges) {
this.q.$('#guild').classList.add('privilege-' + privilege);
}
-
- if (connection.avatarResourceId) {
- (async () => {
- // Update avatar
- if (this.activeGuild === null || this.activeGuild.id !== guild.id) return;
- const src = await ElementsUtil.getImageSrcFromResourceFailSoftly(guild, connection.avatarResourceId);
- if (this.activeGuild === null || this.activeGuild.id !== guild.id) return;
- (this.q.$('#member-avatar') as HTMLImageElement).src = src;
- })();
- } else {
- (this.q.$('#member-avatar') as HTMLImageElement).src = './img/loading.svg';
- }
});
}