add namespaces

This commit is contained in:
marlon-erler
2026-05-06 16:34:29 +00:00
parent dbf3b1a34a
commit 9012dcd2d5
9 changed files with 152 additions and 18 deletions
+57 -8
View File
@@ -412,6 +412,9 @@
settingsHeadline: "Settings", settingsHeadline: "Settings",
primaryChannelLabel: "Primary channel", primaryChannelLabel: "Primary channel",
setPrimaryChannelButtonAudioLabel: "set primary channel", setPrimaryChannelButtonAudioLabel: "set primary channel",
namespaceLabel: "Namespace",
namespacePlaceholder: "No namespace",
setNamespaceButtonAudioLabel: "set namespace",
newSecondaryChannelPlaceholder: "Add secondary channel", newSecondaryChannelPlaceholder: "Add secondary channel",
newSecondaryChannelAudioLabel: "name of new secondary channel", newSecondaryChannelAudioLabel: "name of new secondary channel",
addSecondaryChannelButtonAudioLabel: "add secondary channel", addSecondaryChannelButtonAudioLabel: "add secondary channel",
@@ -624,6 +627,9 @@
settingsHeadline: "Einstellungen", settingsHeadline: "Einstellungen",
primaryChannelLabel: "Hauptkanal", primaryChannelLabel: "Hauptkanal",
setPrimaryChannelButtonAudioLabel: "Hauptkanal festlegen", setPrimaryChannelButtonAudioLabel: "Hauptkanal festlegen",
namespaceLabel: "Namensraum",
namespacePlaceholder: "Ohne Namensraum",
setNamespaceButtonAudioLabel: "Namensraum festlegen",
newSecondaryChannelPlaceholder: "Sekund\xE4ren Kanal hinzuf\xFCgen", newSecondaryChannelPlaceholder: "Sekund\xE4ren Kanal hinzuf\xFCgen",
newSecondaryChannelAudioLabel: "Name des neuen sekund\xE4ren Kanals", newSecondaryChannelAudioLabel: "Name des neuen sekund\xE4ren Kanals",
addSecondaryChannelButtonAudioLabel: "Sekund\xE4ren Kanal hinzuf\xFCgen", addSecondaryChannelButtonAudioLabel: "Sekund\xE4ren Kanal hinzuf\xFCgen",
@@ -824,6 +830,9 @@
settingsHeadline: "Configuraci\xF3n", settingsHeadline: "Configuraci\xF3n",
primaryChannelLabel: "Canal principal", primaryChannelLabel: "Canal principal",
setPrimaryChannelButtonAudioLabel: "establecer canal principal", setPrimaryChannelButtonAudioLabel: "establecer canal principal",
namespaceLabel: "Espacio de nombres",
namespacePlaceholder: "Sin espacio de nombres",
setNamespaceButtonAudioLabel: "establecer espacio de nombres",
newSecondaryChannelPlaceholder: "A\xF1adir canal secundario", newSecondaryChannelPlaceholder: "A\xF1adir canal secundario",
newSecondaryChannelAudioLabel: "nombre del nuevo canal secundario", newSecondaryChannelAudioLabel: "nombre del nuevo canal secundario",
addSecondaryChannelButtonAudioLabel: "a\xF1adir canal secundario", addSecondaryChannelButtonAudioLabel: "a\xF1adir canal secundario",
@@ -1112,7 +1121,7 @@
this.connectionModel = connectionModel2; this.connectionModel = connectionModel2;
this.chatListModel = chatListModel2; this.chatListModel = chatListModel2;
this.fileTransferModel = fileTransferModel2; this.fileTransferModel = fileTransferModel2;
this.BUILD = "Build 26.05.05.A"; this.BUILD = "Build 26.05.06.A";
// CONTEXT // CONTEXT
this.contextStack = /* @__PURE__ */ new Map(); this.contextStack = /* @__PURE__ */ new Map();
this.closeContext = (contextId, fromHistoryEvent = false) => { this.closeContext = (contextId, fromHistoryEvent = false) => {
@@ -1766,7 +1775,7 @@
const chatModels = this.coreViewModel.chatListModel.chatModels; const chatModels = this.coreViewModel.chatListModel.chatModels;
for (const chatModel of chatModels) { for (const chatModel of chatModels) {
this.chatFileOptions.add({ this.chatFileOptions.add({
label: chatModel.info.primaryChannel, label: chatModel.unwrappedPrimaryChannel,
path: chatModel.getBasePath() path: chatModel.getBasePath()
}); });
} }
@@ -3127,6 +3136,8 @@
// state // state
this.primaryChannel = new State(""); this.primaryChannel = new State("");
this.primaryChannelInput = new State(""); this.primaryChannelInput = new State("");
this.namespace = new State("");
this.namespaceInput = new State("");
this.secondaryChannels = new ListState(); this.secondaryChannels = new ListState();
this.newSecondaryChannelInput = new State(""); this.newSecondaryChannelInput = new State("");
this.encryptionKeyInput = new State(""); this.encryptionKeyInput = new State("");
@@ -3141,6 +3152,10 @@
[this.primaryChannel, this.primaryChannelInput], [this.primaryChannel, this.primaryChannelInput],
() => this.primaryChannelInput.value == "" || this.primaryChannelInput.value == this.primaryChannel.value () => this.primaryChannelInput.value == "" || this.primaryChannelInput.value == this.primaryChannel.value
); );
this.cannotSetNamespace = createProxyState(
[this.namespace, this.namespaceInput],
() => this.namespaceInput.value == this.namespace.value
);
this.cannotAddSecondaryChannel = createProxyState( this.cannotAddSecondaryChannel = createProxyState(
[this.newSecondaryChannelInput], [this.newSecondaryChannelInput],
() => this.newSecondaryChannelInput.value == "" () => this.newSecondaryChannelInput.value == ""
@@ -3153,6 +3168,12 @@
this.primaryChannel.value = this.chatViewModel.chatModel.info.primaryChannel; this.primaryChannel.value = this.chatViewModel.chatModel.info.primaryChannel;
this.chatViewModel.chatListViewModel.updateIndices(); this.chatViewModel.chatListViewModel.updateIndices();
}; };
this.setNamespace = () => {
this.chatViewModel.chatModel.setNamespace(
this.namespaceInput.value
);
this.namespace.value = this.chatViewModel.chatModel.info.namespace;
};
this.addSecondaryChannel = () => { this.addSecondaryChannel = () => {
this.secondaryChannels.add(this.newSecondaryChannelInput.value); this.secondaryChannels.add(this.newSecondaryChannelInput.value);
this.newSecondaryChannelInput.value = ""; this.newSecondaryChannelInput.value = "";
@@ -3185,10 +3206,12 @@
// load // load
this.preloadData = () => { this.preloadData = () => {
this.primaryChannel.value = this.chatViewModel.chatModel.info.primaryChannel; this.primaryChannel.value = this.chatViewModel.chatModel.info.primaryChannel;
this.namespace.value = this.chatViewModel.chatModel.info.namespace;
this.color.value = this.chatViewModel.chatModel.color; this.color.value = this.chatViewModel.chatModel.color;
}; };
this.loadData = () => { this.loadData = () => {
this.primaryChannelInput.value = this.chatViewModel.chatModel.info.primaryChannel; this.primaryChannelInput.value = this.primaryChannel.value;
this.namespaceInput.value = this.namespace.value;
this.loadSecondaryChannels(); this.loadSecondaryChannels();
this.encryptionKeyInput.value = this.chatViewModel.chatModel.info.encryptionKey; this.encryptionKeyInput.value = this.chatViewModel.chatModel.info.encryptionKey;
}; };
@@ -3360,6 +3383,11 @@
this.storeInfo(); this.storeInfo();
this.subscribe(); this.subscribe();
}; };
this.setNamespace = (namespace) => {
this.info.namespace = namespace;
this.storeInfo();
this.subscribe();
};
this.setSecondaryChannels = (secondaryChannels) => { this.setSecondaryChannels = (secondaryChannels) => {
this.info.secondaryChannels = secondaryChannels; this.info.secondaryChannels = secondaryChannels;
this.storeInfo(); this.storeInfo();
@@ -3387,7 +3415,7 @@
this.getNameAndChannel = () => { this.getNameAndChannel = () => {
const senderName = this.settingsModel.username; const senderName = this.settingsModel.username;
if (senderName == "") return false; if (senderName == "") return false;
const allChannels = [this.info.primaryChannel]; const allChannels = [this.unwrappedPrimaryChannel];
for (const secondaryChannel of this.info.secondaryChannels) { for (const secondaryChannel of this.info.secondaryChannels) {
allChannels.push(secondaryChannel); allChannels.push(secondaryChannel);
} }
@@ -3436,7 +3464,7 @@
this.handleReaction(reaction); this.handleReaction(reaction);
}; };
this.subscribe = () => { this.subscribe = () => {
this.connectionModel.addChannel(this.info.primaryChannel); this.connectionModel.addChannel(this.unwrappedPrimaryChannel);
}; };
this.setReadStatus = (hasUnreadMessages) => { this.setReadStatus = (hasUnreadMessages) => {
this.info.hasUnreadMessages = hasUnreadMessages; this.info.hasUnreadMessages = hasUnreadMessages;
@@ -3489,6 +3517,9 @@
this this
); );
} }
get unwrappedPrimaryChannel() {
return this.info.namespace + this.info.primaryChannel;
}
get secondaryChannels() { get secondaryChannels() {
return this.info.secondaryChannels.sort(localeCompare); return this.info.secondaryChannels.sort(localeCompare);
} }
@@ -3538,6 +3569,7 @@
return { return {
dataVersion: DATA_VERSION, dataVersion: DATA_VERSION,
primaryChannel, primaryChannel,
namespace: "",
secondaryChannels: [], secondaryChannels: [],
encryptionKey: "", encryptionKey: "",
hasUnreadMessages: false hasUnreadMessages: false
@@ -3597,6 +3629,7 @@
var ChatInfoReference = { var ChatInfoReference = {
dataVersion: DATA_VERSION, dataVersion: DATA_VERSION,
primaryChannel: "", primaryChannel: "",
namespace: "",
secondaryChannels: [""], secondaryChannels: [""],
encryptionKey: "", encryptionKey: "",
hasUnreadMessages: true hasUnreadMessages: true
@@ -4252,7 +4285,7 @@
const notification = _NotificationViewModel.createNotification(message); const notification = _NotificationViewModel.createNotification(message);
if (this.seenMessageIds.has(message.id)) return; if (this.seenMessageIds.has(message.id)) return;
if (this.chatListViewModel.selectedChat.value == void 0) return; if (this.chatListViewModel.selectedChat.value == void 0) return;
const currentChat = this.chatListViewModel.selectedChat.value.chatModel.info.primaryChannel; const currentChat = this.chatListViewModel.selectedChat.value.chatModel.unwrappedPrimaryChannel;
const currentPage = this.chatListViewModel.selectedChat.value.selectedPage.value; const currentPage = this.chatListViewModel.selectedChat.value.selectedPage.value;
if (notification.chat == currentChat && currentPage == "messages" /* Messages */) if (notification.chat == currentChat && currentPage == "messages" /* Messages */)
return; return;
@@ -4265,7 +4298,7 @@
const chat = [ const chat = [
...this.chatListViewModel.chatViewModels.value.values() ...this.chatListViewModel.chatViewModels.value.values()
].find( ].find(
(chat2) => chat2.chatModel.info.primaryChannel == notification.chat (chat2) => chat2.chatModel.unwrappedPrimaryChannel == notification.chat
); );
chat.open(); chat.open();
chat.openPage("messages" /* Messages */); chat.openPage("messages" /* Messages */);
@@ -5513,6 +5546,22 @@
}, },
coreViewModel2.translations.general.setButton, coreViewModel2.translations.general.setButton,
/* @__PURE__ */ createElement("span", { class: "icon" }, "check") /* @__PURE__ */ createElement("span", { class: "icon" }, "check")
)), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("label", { class: "tile flex-no" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "category"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", null, coreViewModel2.translations.chatPage.settings.namespaceLabel), /* @__PURE__ */ createElement(
"input",
{
"bind:value": settingsPageViewModel.namespaceInput,
"on:enter": settingsPageViewModel.setNamespace
}
))), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end width-input" }, /* @__PURE__ */ createElement(
"button",
{
class: "width-50",
"aria-label": coreViewModel2.translations.chatPage.settings.setNamespaceButtonAudioLabel,
"on:click": settingsPageViewModel.setNamespace,
"toggle:disabled": settingsPageViewModel.cannotSetNamespace
},
coreViewModel2.translations.general.setButton,
/* @__PURE__ */ createElement("span", { class: "icon" }, "check")
)), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("div", { class: "flex-row width-input margin-bottom" }, /* @__PURE__ */ createElement( )), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("div", { class: "flex-row width-input margin-bottom" }, /* @__PURE__ */ createElement(
"input", "input",
{ {
@@ -7571,7 +7620,7 @@
const allChannels = channel.split("/"); const allChannels = channel.split("/");
for (const chatModel of this.chatModels) { for (const chatModel of this.chatModels) {
for (const channel2 of allChannels) { for (const channel2 of allChannels) {
if (channel2 != chatModel.info.primaryChannel) continue; if (channel2 != chatModel.unwrappedPrimaryChannel) continue;
fn(chatModel); fn(chatModel);
break; break;
} }
+1 -1
View File
@@ -73,7 +73,7 @@ export default class ChatListModel {
for (const chatModel of this.chatModels) { for (const chatModel of this.chatModels) {
for (const channel of allChannels) { for (const channel of allChannels) {
if (channel != chatModel.info.primaryChannel) continue; if (channel != chatModel.unwrappedPrimaryChannel) continue;
fn(chatModel); fn(chatModel);
break; break;
} }
+15 -2
View File
@@ -37,6 +37,10 @@ export default class ChatModel {
info: ChatInfo; info: ChatInfo;
color: Colors; color: Colors;
get unwrappedPrimaryChannel(): string {
return this.info.namespace + this.info.primaryChannel;
}
get secondaryChannels(): string[] { get secondaryChannels(): string[] {
return this.info.secondaryChannels.sort(localeCompare); return this.info.secondaryChannels.sort(localeCompare);
} }
@@ -133,6 +137,12 @@ export default class ChatModel {
this.storeInfo(); this.storeInfo();
this.subscribe(); this.subscribe();
}; };
readonly setNamespace = (namespace: string): void => {
this.info.namespace = namespace;
this.storeInfo();
this.subscribe();
};
readonly setSecondaryChannels = (secondaryChannels: string[]): void => { readonly setSecondaryChannels = (secondaryChannels: string[]): void => {
this.info.secondaryChannels = secondaryChannels; this.info.secondaryChannels = secondaryChannels;
@@ -170,7 +180,7 @@ export default class ChatModel {
const senderName: string = this.settingsModel.username; const senderName: string = this.settingsModel.username;
if (senderName == "") return false; if (senderName == "") return false;
const allChannels: string[] = [this.info.primaryChannel]; const allChannels: string[] = [this.unwrappedPrimaryChannel];
for (const secondaryChannel of this.info.secondaryChannels) { for (const secondaryChannel of this.info.secondaryChannels) {
allChannels.push(secondaryChannel); allChannels.push(secondaryChannel);
} }
@@ -238,7 +248,7 @@ export default class ChatModel {
}; };
readonly subscribe = (): void => { readonly subscribe = (): void => {
this.connectionModel.addChannel(this.info.primaryChannel); this.connectionModel.addChannel(this.unwrappedPrimaryChannel);
}; };
readonly setReadStatus = (hasUnreadMessages: boolean): void => { readonly setReadStatus = (hasUnreadMessages: boolean): void => {
@@ -367,6 +377,7 @@ export default class ChatModel {
dataVersion: DATA_VERSION, dataVersion: DATA_VERSION,
primaryChannel, primaryChannel,
namespace: "",
secondaryChannels: [], secondaryChannels: [],
encryptionKey: "", encryptionKey: "",
hasUnreadMessages: false, hasUnreadMessages: false,
@@ -454,6 +465,7 @@ export enum ReactionSymbols {
export interface ChatInfo extends ValidObject { export interface ChatInfo extends ValidObject {
primaryChannel: string; primaryChannel: string;
namespace: string;
secondaryChannels: string[]; secondaryChannels: string[];
encryptionKey: string; encryptionKey: string;
@@ -494,6 +506,7 @@ export const ChatInfoReference: ChatInfo = {
dataVersion: DATA_VERSION, dataVersion: DATA_VERSION,
primaryChannel: "", primaryChannel: "",
namespace: "",
secondaryChannels: [""], secondaryChannels: [""],
encryptionKey: "", encryptionKey: "",
+40
View File
@@ -77,6 +77,46 @@ export function SettingsPage(
<hr></hr> <hr></hr>
<label class="tile flex-no">
<span class="icon">category</span>
<div>
<span>
{
coreViewModel.translations.chatPage
.settings.namespaceLabel
}
</span>
<input
bind:value={
settingsPageViewModel.namespaceInput
}
on:enter={
settingsPageViewModel.setNamespace
}
></input>
</div>
</label>
<div class="flex-row justify-end width-input">
<button
class="width-50"
aria-label={
coreViewModel.translations.chatPage.settings
.setNamespaceButtonAudioLabel
}
on:click={
settingsPageViewModel.setNamespace
}
toggle:disabled={
settingsPageViewModel.cannotSetNamespace
}
>
{coreViewModel.translations.general.setButton}
<span class="icon">check</span>
</button>
</div>
<hr></hr>
<div class="flex-row width-input margin-bottom"> <div class="flex-row width-input margin-bottom">
<input <input
aria-label={ aria-label={
+12
View File
@@ -171,6 +171,10 @@ const englishTranslations = {
primaryChannelLabel: "Primary channel", primaryChannelLabel: "Primary channel",
setPrimaryChannelButtonAudioLabel: "set primary channel", setPrimaryChannelButtonAudioLabel: "set primary channel",
namespaceLabel: "Namespace",
namespacePlaceholder: "No namespace",
setNamespaceButtonAudioLabel: "set namespace",
newSecondaryChannelPlaceholder: "Add secondary channel", newSecondaryChannelPlaceholder: "Add secondary channel",
newSecondaryChannelAudioLabel: "name of new secondary channel", newSecondaryChannelAudioLabel: "name of new secondary channel",
addSecondaryChannelButtonAudioLabel: "add secondary channel", addSecondaryChannelButtonAudioLabel: "add secondary channel",
@@ -472,6 +476,10 @@ export const allTranslations: {
primaryChannelLabel: "Hauptkanal", primaryChannelLabel: "Hauptkanal",
setPrimaryChannelButtonAudioLabel: "Hauptkanal festlegen", setPrimaryChannelButtonAudioLabel: "Hauptkanal festlegen",
namespaceLabel: "Namensraum",
namespacePlaceholder: "Ohne Namensraum",
setNamespaceButtonAudioLabel: "Namensraum festlegen",
newSecondaryChannelPlaceholder: "Sekundären Kanal hinzufügen", newSecondaryChannelPlaceholder: "Sekundären Kanal hinzufügen",
newSecondaryChannelAudioLabel: newSecondaryChannelAudioLabel:
"Name des neuen sekundären Kanals", "Name des neuen sekundären Kanals",
@@ -749,6 +757,10 @@ export const allTranslations: {
primaryChannelLabel: "Canal principal", primaryChannelLabel: "Canal principal",
setPrimaryChannelButtonAudioLabel: "establecer canal principal", setPrimaryChannelButtonAudioLabel: "establecer canal principal",
namespaceLabel: "Espacio de nombres",
namespacePlaceholder: "Sin espacio de nombres",
setNamespaceButtonAudioLabel: "establecer espacio de nombres",
newSecondaryChannelPlaceholder: "Añadir canal secundario", newSecondaryChannelPlaceholder: "Añadir canal secundario",
newSecondaryChannelAudioLabel: newSecondaryChannelAudioLabel:
"nombre del nuevo canal secundario", "nombre del nuevo canal secundario",
+1 -1
View File
@@ -9,7 +9,7 @@ import ConnectionModel from "../../Model/Global/connectionModel";
import ChatListModel from "../../Model/Chat/chatListModel"; import ChatListModel from "../../Model/Chat/chatListModel";
export default class CoreViewModel { export default class CoreViewModel {
readonly BUILD = "Build 26.05.05.B"; readonly BUILD = "Build 26.05.06.A";
translations: Translations; translations: Translations;
@@ -98,7 +98,7 @@ export default class FileTransferViewModel extends Context {
this.coreViewModel.chatListModel.chatModels; this.coreViewModel.chatListModel.chatModels;
for (const chatModel of chatModels) { for (const chatModel of chatModels) {
this.chatFileOptions.add({ this.chatFileOptions.add({
label: chatModel.info.primaryChannel, label: chatModel.unwrappedPrimaryChannel,
path: chatModel.getBasePath(), path: chatModel.getBasePath(),
}); });
} }
@@ -20,8 +20,8 @@ export default class NotificationViewModel {
if (this.chatListViewModel.selectedChat.value == undefined) return; if (this.chatListViewModel.selectedChat.value == undefined) return;
const currentChat = const currentChat =
this.chatListViewModel.selectedChat.value.chatModel.info this.chatListViewModel.selectedChat.value.chatModel.
.primaryChannel; unwrappedPrimaryChannel
const currentPage = const currentPage =
this.chatListViewModel.selectedChat.value.selectedPage.value; this.chatListViewModel.selectedChat.value.selectedPage.value;
if ( if (
@@ -41,7 +41,7 @@ export default class NotificationViewModel {
const chat = [ const chat = [
...this.chatListViewModel.chatViewModels.value.values(), ...this.chatListViewModel.chatViewModels.value.values(),
].find( ].find(
(chat) => chat.chatModel.info.primaryChannel == notification.chat, (chat) => chat.chatModel.unwrappedPrimaryChannel == notification.chat,
); );
chat.open(); chat.open();
chat.openPage(ChatPageTypes.Messages); chat.openPage(ChatPageTypes.Messages);
@@ -79,7 +79,7 @@ export default class NotificationViewModel {
}; };
// init // init
constructor(public readonly chatListViewModel: ChatListViewModel) {} constructor(public readonly chatListViewModel: ChatListViewModel) { }
// util // util
static createNotification(message: ChatMessage): Notification { static createNotification(message: ChatMessage): Notification {
+21 -1
View File
@@ -8,6 +8,9 @@ export default class SettingsPageViewModel extends Context {
primaryChannel: React.State<string> = new React.State(""); primaryChannel: React.State<string> = new React.State("");
primaryChannelInput: React.State<string> = new React.State(""); primaryChannelInput: React.State<string> = new React.State("");
namespace: React.State<string> = new React.State("");
namespaceInput: React.State<string> = new React.State("");
secondaryChannels: React.ListState<string> = new React.ListState(); secondaryChannels: React.ListState<string> = new React.ListState();
newSecondaryChannelInput: React.State<string> = new React.State(""); newSecondaryChannelInput: React.State<string> = new React.State("");
@@ -27,6 +30,11 @@ export default class SettingsPageViewModel extends Context {
this.primaryChannelInput.value == "" || this.primaryChannelInput.value == "" ||
this.primaryChannelInput.value == this.primaryChannel.value, this.primaryChannelInput.value == this.primaryChannel.value,
); );
cannotSetNamespace: React.State<boolean> = React.createProxyState(
[this.namespace, this.namespaceInput],
() =>
this.namespaceInput.value == this.namespace.value,
);
cannotAddSecondaryChannel: React.State<boolean> = React.createProxyState( cannotAddSecondaryChannel: React.State<boolean> = React.createProxyState(
[this.newSecondaryChannelInput], [this.newSecondaryChannelInput],
() => this.newSecondaryChannelInput.value == "", () => this.newSecondaryChannelInput.value == "",
@@ -44,6 +52,14 @@ export default class SettingsPageViewModel extends Context {
this.chatViewModel.chatListViewModel.updateIndices(); this.chatViewModel.chatListViewModel.updateIndices();
}; };
setNamespace = (): void => {
this.chatViewModel.chatModel.setNamespace(
this.namespaceInput.value,
);
this.namespace.value =
this.chatViewModel.chatModel.info.namespace;
};
addSecondaryChannel = (): void => { addSecondaryChannel = (): void => {
this.secondaryChannels.add(this.newSecondaryChannelInput.value); this.secondaryChannels.add(this.newSecondaryChannelInput.value);
this.newSecondaryChannelInput.value = ""; this.newSecondaryChannelInput.value = "";
@@ -85,13 +101,17 @@ export default class SettingsPageViewModel extends Context {
preloadData = (): void => { preloadData = (): void => {
this.primaryChannel.value = this.primaryChannel.value =
this.chatViewModel.chatModel.info.primaryChannel; this.chatViewModel.chatModel.info.primaryChannel;
this.namespace.value =
this.chatViewModel.chatModel.info.namespace;
this.color.value = this.chatViewModel.chatModel.color; this.color.value = this.chatViewModel.chatModel.color;
}; };
loadData = (): void => { loadData = (): void => {
this.primaryChannelInput.value = this.primaryChannelInput.value =
this.chatViewModel.chatModel.info.primaryChannel; this.primaryChannel.value;
this.namespaceInput.value =
this.namespace.value;
this.loadSecondaryChannels(); this.loadSecondaryChannels();