cleanup
This commit is contained in:
Vendored
+9
-9
@@ -2356,23 +2356,23 @@
|
|||||||
|
|
||||||
// src/View/chatPage.tsx
|
// src/View/chatPage.tsx
|
||||||
function ChatPage(chatViewModel) {
|
function ChatPage(chatViewModel) {
|
||||||
const mainContent = new State(/* @__PURE__ */ createElement("div", null));
|
const mainContent = createProxyState(
|
||||||
chatViewModel.selectedPage.subscribe((selectedPage) => {
|
[chatViewModel.selectedPage],
|
||||||
|
() => {
|
||||||
chatViewModel.closeSubPages();
|
chatViewModel.closeSubPages();
|
||||||
switch (selectedPage) {
|
switch (chatViewModel.selectedPage.value) {
|
||||||
case "settings" /* Settings */: {
|
case "settings" /* Settings */: {
|
||||||
mainContent.value = SettingsPage(chatViewModel.settingsPageViewModel);
|
return SettingsPage(chatViewModel.settingsPageViewModel);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case "tasks" /* Tasks */: {
|
case "tasks" /* Tasks */: {
|
||||||
mainContent.value = TaskPage(chatViewModel.taskPageViewModel);
|
return TaskPage(chatViewModel.taskPageViewModel);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
mainContent.value = MessagePage(chatViewModel.messagePageViewModel);
|
return MessagePage(chatViewModel.messagePageViewModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
return /* @__PURE__ */ createElement(
|
return /* @__PURE__ */ createElement(
|
||||||
"article",
|
"article",
|
||||||
{
|
{
|
||||||
|
|||||||
+9
-10
@@ -11,25 +11,24 @@ import { TaskPage } from "./ChatPages/taskPage";
|
|||||||
import { translations } from "./translations";
|
import { translations } from "./translations";
|
||||||
|
|
||||||
export function ChatPage(chatViewModel: ChatViewModel) {
|
export function ChatPage(chatViewModel: ChatViewModel) {
|
||||||
const mainContent = new React.State(<div></div>);
|
const mainContent = React.createProxyState(
|
||||||
|
[chatViewModel.selectedPage],
|
||||||
chatViewModel.selectedPage.subscribe((selectedPage) => {
|
() => {
|
||||||
chatViewModel.closeSubPages();
|
chatViewModel.closeSubPages();
|
||||||
|
|
||||||
switch (selectedPage) {
|
switch (chatViewModel.selectedPage.value) {
|
||||||
case ChatPageType.Settings: {
|
case ChatPageType.Settings: {
|
||||||
mainContent.value = SettingsPage(chatViewModel.settingsPageViewModel);
|
return SettingsPage(chatViewModel.settingsPageViewModel);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case ChatPageType.Tasks: {
|
case ChatPageType.Tasks: {
|
||||||
mainContent.value = TaskPage(chatViewModel.taskPageViewModel);
|
return TaskPage(chatViewModel.taskPageViewModel);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
mainContent.value = MessagePage(chatViewModel.messagePageViewModel);
|
return MessagePage(chatViewModel.messagePageViewModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article
|
<article
|
||||||
|
|||||||
Reference in New Issue
Block a user