cleanup
This commit is contained in:
@@ -55,15 +55,6 @@ export default class MessagePageViewModel {
|
||||
|
||||
// load
|
||||
loadData = (): void => {
|
||||
this.cannotSendMessage = React.createProxyState(
|
||||
[this.chatViewModel.settingsViewModel.username, this.composingMessage],
|
||||
() =>
|
||||
this.chatViewModel.settingsViewModel.username.value == "" ||
|
||||
this.composingMessage.value == ""
|
||||
);
|
||||
};
|
||||
|
||||
loadMessages = (): void => {
|
||||
for (const chatMessage of this.chatViewModel.chatModel.messages) {
|
||||
this.addChatMessage(chatMessage);
|
||||
}
|
||||
@@ -72,6 +63,12 @@ export default class MessagePageViewModel {
|
||||
// init
|
||||
constructor(chatViewModel: ChatViewModel) {
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.loadData();
|
||||
|
||||
this.cannotSendMessage = React.createProxyState(
|
||||
[this.chatViewModel.settingsViewModel.username, this.composingMessage],
|
||||
() =>
|
||||
this.chatViewModel.settingsViewModel.username.value == "" ||
|
||||
this.composingMessage.value == ""
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,13 +89,6 @@ export default class SettingsPageViewModel {
|
||||
this.chatViewModel.chatModel.info.primaryChannel;
|
||||
|
||||
this.color.value = this.chatViewModel.chatModel.color;
|
||||
|
||||
this.cannotSetEncryptionKey = React.createProxyState(
|
||||
[this.encryptionKeyInput],
|
||||
() =>
|
||||
this.encryptionKeyInput.value ==
|
||||
this.chatViewModel.chatModel.info.encryptionKey
|
||||
);
|
||||
};
|
||||
|
||||
loadData = (): void => {
|
||||
@@ -120,5 +113,12 @@ export default class SettingsPageViewModel {
|
||||
constructor(chatViewModel: ChatViewModel) {
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.loadListRelevantData();
|
||||
|
||||
this.cannotSetEncryptionKey = React.createProxyState(
|
||||
[this.encryptionKeyInput],
|
||||
() =>
|
||||
this.encryptionKeyInput.value ==
|
||||
this.chatViewModel.chatModel.info.encryptionKey
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user