move name to settings modal
This commit is contained in:
Vendored
+192
-123
@@ -351,9 +351,6 @@
|
|||||||
connectAudioLabel: "connect to server",
|
connectAudioLabel: "connect to server",
|
||||||
disconnectAudioLabel: "disconnect from server",
|
disconnectAudioLabel: "disconnect from server",
|
||||||
manageConnectionsAudioLabel: "manage connections",
|
manageConnectionsAudioLabel: "manage connections",
|
||||||
yourNameLabel: "Your name",
|
|
||||||
yourNamePlaceholder: "Jane Doe",
|
|
||||||
setNameButtonAudioLabel: "set name",
|
|
||||||
settingsButton: "Settings",
|
settingsButton: "Settings",
|
||||||
manageStorageButton: "Manage storage",
|
manageStorageButton: "Manage storage",
|
||||||
transferDataButton: "Transfer or export data",
|
transferDataButton: "Transfer or export data",
|
||||||
@@ -369,6 +366,7 @@
|
|||||||
settings: {
|
settings: {
|
||||||
pages: {
|
pages: {
|
||||||
appearance: "Appearance",
|
appearance: "Appearance",
|
||||||
|
account: "Account",
|
||||||
regional: "Language & Region",
|
regional: "Language & Region",
|
||||||
info: "About CT"
|
info: "About CT"
|
||||||
},
|
},
|
||||||
@@ -379,10 +377,19 @@
|
|||||||
system: "Device theme",
|
system: "Device theme",
|
||||||
black: "Black"
|
black: "Black"
|
||||||
},
|
},
|
||||||
version: "Version",
|
account: {
|
||||||
|
yourNameLabel: "Your name",
|
||||||
|
yourNamePlaceholder: "Jane Doe",
|
||||||
|
setNameButtonAudioLabel: "set name"
|
||||||
|
},
|
||||||
|
regional: {
|
||||||
language: "Language",
|
language: "Language",
|
||||||
firstDayOfWeekLabel: "First day of week",
|
firstDayOfWeekLabel: "First day of week"
|
||||||
|
},
|
||||||
|
about: {
|
||||||
|
version: "Version",
|
||||||
checkUpdatesButton: "Check for updates"
|
checkUpdatesButton: "Check for updates"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
connectionModal: {
|
connectionModal: {
|
||||||
connectionModalHeadline: "Manage Connections",
|
connectionModalHeadline: "Manage Connections",
|
||||||
@@ -600,9 +607,6 @@
|
|||||||
connectAudioLabel: "mit Server verbinden",
|
connectAudioLabel: "mit Server verbinden",
|
||||||
disconnectAudioLabel: "vom Server trennen",
|
disconnectAudioLabel: "vom Server trennen",
|
||||||
manageConnectionsAudioLabel: "Verbindungen verwalten",
|
manageConnectionsAudioLabel: "Verbindungen verwalten",
|
||||||
yourNameLabel: "Dein Name",
|
|
||||||
yourNamePlaceholder: "Max Mustermann",
|
|
||||||
setNameButtonAudioLabel: "Name speichern",
|
|
||||||
settingsButton: "Einstellungen",
|
settingsButton: "Einstellungen",
|
||||||
manageStorageButton: "Daten verwalten",
|
manageStorageButton: "Daten verwalten",
|
||||||
transferDataButton: "Daten \xFCbertragen",
|
transferDataButton: "Daten \xFCbertragen",
|
||||||
@@ -617,6 +621,7 @@
|
|||||||
settings: {
|
settings: {
|
||||||
pages: {
|
pages: {
|
||||||
appearance: "Erscheinungsbild",
|
appearance: "Erscheinungsbild",
|
||||||
|
account: "Konto",
|
||||||
regional: "Sprache & Region",
|
regional: "Sprache & Region",
|
||||||
info: "\xDCber CT"
|
info: "\xDCber CT"
|
||||||
},
|
},
|
||||||
@@ -627,10 +632,19 @@
|
|||||||
system: "Ger\xE4teeinstellung",
|
system: "Ger\xE4teeinstellung",
|
||||||
black: "Schwarz"
|
black: "Schwarz"
|
||||||
},
|
},
|
||||||
version: "Version",
|
account: {
|
||||||
|
yourNameLabel: "Dein Name",
|
||||||
|
yourNamePlaceholder: "Max Mustermann",
|
||||||
|
setNameButtonAudioLabel: "Namen festlegen"
|
||||||
|
},
|
||||||
|
regional: {
|
||||||
language: "Sprache",
|
language: "Sprache",
|
||||||
firstDayOfWeekLabel: "Erster Wochentag",
|
firstDayOfWeekLabel: "Erster Wochentag"
|
||||||
checkUpdatesButton: "Nach updates suchen"
|
},
|
||||||
|
about: {
|
||||||
|
version: "Version",
|
||||||
|
checkUpdatesButton: "Nach Updates suchen"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
connectionModal: {
|
connectionModal: {
|
||||||
connectionModalHeadline: "Verbindungen verwalten",
|
connectionModalHeadline: "Verbindungen verwalten",
|
||||||
@@ -829,9 +843,6 @@
|
|||||||
connectAudioLabel: "conectar al servidor",
|
connectAudioLabel: "conectar al servidor",
|
||||||
disconnectAudioLabel: "desconectar del servidor",
|
disconnectAudioLabel: "desconectar del servidor",
|
||||||
manageConnectionsAudioLabel: "gestionar conexiones",
|
manageConnectionsAudioLabel: "gestionar conexiones",
|
||||||
yourNameLabel: "Tu nombre",
|
|
||||||
yourNamePlaceholder: "Juan P\xE9rez",
|
|
||||||
setNameButtonAudioLabel: "establecer nombre",
|
|
||||||
settingsButton: "Ajustes",
|
settingsButton: "Ajustes",
|
||||||
manageStorageButton: "Gestionar almacenamiento",
|
manageStorageButton: "Gestionar almacenamiento",
|
||||||
transferDataButton: "Enviar o exportar archivos",
|
transferDataButton: "Enviar o exportar archivos",
|
||||||
@@ -846,6 +857,7 @@
|
|||||||
settings: {
|
settings: {
|
||||||
pages: {
|
pages: {
|
||||||
appearance: "Aspecto",
|
appearance: "Aspecto",
|
||||||
|
account: "Cuenta",
|
||||||
regional: "Idioma y Regi\xF3n",
|
regional: "Idioma y Regi\xF3n",
|
||||||
info: "Sobre CT"
|
info: "Sobre CT"
|
||||||
},
|
},
|
||||||
@@ -856,10 +868,19 @@
|
|||||||
system: "Seg\xFAn dispositivo",
|
system: "Seg\xFAn dispositivo",
|
||||||
black: "Negro"
|
black: "Negro"
|
||||||
},
|
},
|
||||||
version: "Versi\xF3n",
|
account: {
|
||||||
|
yourNameLabel: "Tu nombre",
|
||||||
|
yourNamePlaceholder: "Juan P\xE9rez",
|
||||||
|
setNameButtonAudioLabel: "establecer nombre"
|
||||||
|
},
|
||||||
|
regional: {
|
||||||
language: "Idioma",
|
language: "Idioma",
|
||||||
firstDayOfWeekLabel: "Primer d\xEDa de la semana",
|
firstDayOfWeekLabel: "Primer d\xEDa de la semana"
|
||||||
checkUpdatesButton: "Buscar actualizaciones"
|
},
|
||||||
|
about: {
|
||||||
|
version: "Versi\xF3n",
|
||||||
|
checkUpdatesButton: "Buscar actualisaciones"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
connectionModal: {
|
connectionModal: {
|
||||||
connectionModalHeadline: "Gestionar Conexiones",
|
connectionModalHeadline: "Gestionar Conexiones",
|
||||||
@@ -1862,9 +1883,8 @@
|
|||||||
// src/Model/Global/settingsModel.ts
|
// src/Model/Global/settingsModel.ts
|
||||||
var SettingsModel = class _SettingsModel {
|
var SettingsModel = class _SettingsModel {
|
||||||
// init
|
// init
|
||||||
constructor(storageModel2, contactListModel2) {
|
constructor(storageModel2) {
|
||||||
this.storageModel = storageModel2;
|
this.storageModel = storageModel2;
|
||||||
this.contactListModel = contactListModel2;
|
|
||||||
// data
|
// data
|
||||||
this.username = "";
|
this.username = "";
|
||||||
this.userid = "";
|
this.userid = "";
|
||||||
@@ -1886,7 +1906,6 @@
|
|||||||
this.setName = (newValue) => {
|
this.setName = (newValue) => {
|
||||||
this.username = newValue;
|
this.username = newValue;
|
||||||
this.storeSetting("username", newValue);
|
this.storeSetting("username", newValue);
|
||||||
this.contactListModel.storeContact(this.userid, newValue);
|
|
||||||
};
|
};
|
||||||
this.setFirstDayOfWeek = (newValue) => {
|
this.setFirstDayOfWeek = (newValue) => {
|
||||||
this.firstDayOfWeek = newValue;
|
this.firstDayOfWeek = newValue;
|
||||||
@@ -1976,7 +1995,10 @@
|
|||||||
() => this.usernameInput.value == "" || this.usernameInput.value == this.coreViewModel.settingsModel.username
|
() => this.usernameInput.value == "" || this.usernameInput.value == this.coreViewModel.settingsModel.username
|
||||||
);
|
);
|
||||||
// methods
|
// methods
|
||||||
this.setName = () => {
|
this.setName = (name) => {
|
||||||
|
if (typeof name == "string") {
|
||||||
|
this.usernameInput.value = name;
|
||||||
|
}
|
||||||
this.coreViewModel.settingsModel.setName(this.usernameInput.value);
|
this.coreViewModel.settingsModel.setName(this.usernameInput.value);
|
||||||
this.username.value = this.coreViewModel.settingsModel.username;
|
this.username.value = this.coreViewModel.settingsModel.username;
|
||||||
this.usernameInput.callSubscriptions();
|
this.usernameInput.callSubscriptions();
|
||||||
@@ -2362,6 +2384,58 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// src/ViewModel/Global/contactViewModel.ts
|
||||||
|
var ContactListViewModel = class {
|
||||||
|
// init
|
||||||
|
constructor(contactListModel2, settingsViewModel2) {
|
||||||
|
this.contactListModel = contactListModel2;
|
||||||
|
this.settingsViewModel = settingsViewModel2;
|
||||||
|
// state
|
||||||
|
this.contacts = /* @__PURE__ */ new Map();
|
||||||
|
// main
|
||||||
|
this.updateContact = (id, name) => {
|
||||||
|
if (id == this.settingsViewModel.settingsModel.userid) {
|
||||||
|
this.settingsViewModel.setName(name);
|
||||||
|
}
|
||||||
|
const match = this.contacts.get(id);
|
||||||
|
if (match) {
|
||||||
|
match.name.value = name;
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
const vm = new ContactViewModel(id, name);
|
||||||
|
this.contacts.set(id, vm);
|
||||||
|
return vm;
|
||||||
|
};
|
||||||
|
this.handleContact = (contact) => {
|
||||||
|
this.updateContact(...contact);
|
||||||
|
};
|
||||||
|
this.unwrapContact = (id, knownName) => {
|
||||||
|
if (this.contacts.has(id))
|
||||||
|
return this.contacts.get(id);
|
||||||
|
return this.updateContact(id, knownName);
|
||||||
|
};
|
||||||
|
// load
|
||||||
|
this.loadData = () => {
|
||||||
|
const contacts = this.contactListModel.loadContacts();
|
||||||
|
for (const contact of contacts) {
|
||||||
|
const vm = new ContactViewModel(...contact);
|
||||||
|
this.contacts.set(vm.id, vm);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.loadData();
|
||||||
|
this.contactListModel.contactHandlerManager.setHandler("contact-list-view-model", this.handleContact);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var ContactViewModel = class {
|
||||||
|
// init
|
||||||
|
constructor(id, name) {
|
||||||
|
this.id = id;
|
||||||
|
// state
|
||||||
|
this.name = new State("");
|
||||||
|
this.name.value = name;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// src/ViewModel/Global/connectionViewModel.ts
|
// src/ViewModel/Global/connectionViewModel.ts
|
||||||
var ConnectionViewModel = class {
|
var ConnectionViewModel = class {
|
||||||
// init
|
// init
|
||||||
@@ -2952,9 +3026,14 @@
|
|||||||
// messaging
|
// messaging
|
||||||
this.addMessage = async (chatMessage) => {
|
this.addMessage = async (chatMessage) => {
|
||||||
await this.decryptMessage(chatMessage);
|
await this.decryptMessage(chatMessage);
|
||||||
this.contactListModel.storeContact(chatMessage.senderId, chatMessage.senderName);
|
this.contactListModel.storeContact(
|
||||||
|
chatMessage.senderId,
|
||||||
|
chatMessage.senderName
|
||||||
|
);
|
||||||
if (chatMessage.body != "") {
|
if (chatMessage.body != "") {
|
||||||
const messagePath = this.getMessagePath(chatMessage.fileId);
|
const messagePath = this.getMessagePath(
|
||||||
|
chatMessage.fileId
|
||||||
|
);
|
||||||
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
||||||
this.chatMessageHandlerManager.trigger(chatMessage);
|
this.chatMessageHandlerManager.trigger(chatMessage);
|
||||||
}
|
}
|
||||||
@@ -5196,23 +5275,6 @@
|
|||||||
"toggle:disabled": connectionViewModel2.cannotConnect
|
"toggle:disabled": connectionViewModel2.cannotConnect
|
||||||
},
|
},
|
||||||
/* @__PURE__ */ createElement("span", { class: "icon" }, "link")
|
/* @__PURE__ */ createElement("span", { class: "icon" }, "link")
|
||||||
)), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("label", { class: "tile flex-no" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "account_circle"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", null, coreViewModel2.translations.homePage.yourNameLabel), /* @__PURE__ */ createElement(
|
|
||||||
"input",
|
|
||||||
{
|
|
||||||
placeholder: coreViewModel2.translations.homePage.yourNamePlaceholder,
|
|
||||||
"bind:value": settingsViewModel2.usernameInput,
|
|
||||||
"on:enter": settingsViewModel2.setName
|
|
||||||
}
|
|
||||||
))), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end" }, /* @__PURE__ */ createElement(
|
|
||||||
"button",
|
|
||||||
{
|
|
||||||
class: "width-50",
|
|
||||||
"on:click": settingsViewModel2.setName,
|
|
||||||
"toggle:disabled": settingsViewModel2.cannotSetName,
|
|
||||||
"aria-label": coreViewModel2.translations.homePage.setNameButtonAudioLabel
|
|
||||||
},
|
|
||||||
coreViewModel2.translations.general.setButton,
|
|
||||||
/* @__PURE__ */ createElement("span", { class: "icon" }, "check")
|
|
||||||
)), /* @__PURE__ */ createElement("hr", null), HomePageButton(
|
)), /* @__PURE__ */ createElement("hr", null), HomePageButton(
|
||||||
settingsViewModel2.showSettingsModal,
|
settingsViewModel2.showSettingsModal,
|
||||||
coreViewModel2.translations.homePage.settingsButton,
|
coreViewModel2.translations.homePage.settingsButton,
|
||||||
@@ -6476,7 +6538,13 @@
|
|||||||
|
|
||||||
// src/View/Components/replyPreview.tsx
|
// src/View/Components/replyPreview.tsx
|
||||||
function ReplyPreview(coreViewModel2, chatMessageViewModel) {
|
function ReplyPreview(coreViewModel2, chatMessageViewModel) {
|
||||||
return /* @__PURE__ */ createElement("div", { class: "reply-preview" }, /* @__PURE__ */ createElement("div", { class: "surface blur" }, /* @__PURE__ */ createElement("span", { class: "secondary", "subscribe:innerText": chatMessageViewModel.contact.name }), /* @__PURE__ */ createElement(
|
return /* @__PURE__ */ createElement("div", { class: "reply-preview" }, /* @__PURE__ */ createElement("div", { class: "surface blur" }, /* @__PURE__ */ createElement(
|
||||||
|
"span",
|
||||||
|
{
|
||||||
|
class: "secondary",
|
||||||
|
"subscribe:innerText": chatMessageViewModel.contact.name
|
||||||
|
}
|
||||||
|
), /* @__PURE__ */ createElement(
|
||||||
"b",
|
"b",
|
||||||
{
|
{
|
||||||
class: "ellipsis",
|
class: "ellipsis",
|
||||||
@@ -7430,12 +7498,17 @@
|
|||||||
coreViewModel2,
|
coreViewModel2,
|
||||||
settingsViewModel2
|
settingsViewModel2
|
||||||
);
|
);
|
||||||
case 1 /* Regional */:
|
case 1 /* Account */:
|
||||||
|
return SettingsAccountPane(
|
||||||
|
coreViewModel2,
|
||||||
|
settingsViewModel2
|
||||||
|
);
|
||||||
|
case 2 /* Regional */:
|
||||||
return SettingsRegionalPane(
|
return SettingsRegionalPane(
|
||||||
coreViewModel2,
|
coreViewModel2,
|
||||||
settingsViewModel2
|
settingsViewModel2
|
||||||
);
|
);
|
||||||
case 2 /* Info */:
|
case 3 /* Info */:
|
||||||
return SettingsInfoPane(coreViewModel2, settingsViewModel2);
|
return SettingsInfoPane(coreViewModel2, settingsViewModel2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7466,12 +7539,17 @@
|
|||||||
), SettingsPaneButton(
|
), SettingsPaneButton(
|
||||||
coreViewModel2,
|
coreViewModel2,
|
||||||
settingsViewModel2,
|
settingsViewModel2,
|
||||||
1 /* Regional */,
|
1 /* Account */,
|
||||||
|
coreViewModel2.translations.settings.pages.account
|
||||||
|
), SettingsPaneButton(
|
||||||
|
coreViewModel2,
|
||||||
|
settingsViewModel2,
|
||||||
|
2 /* Regional */,
|
||||||
coreViewModel2.translations.settings.pages.regional
|
coreViewModel2.translations.settings.pages.regional
|
||||||
), SettingsPaneButton(
|
), SettingsPaneButton(
|
||||||
coreViewModel2,
|
coreViewModel2,
|
||||||
settingsViewModel2,
|
settingsViewModel2,
|
||||||
2 /* Info */,
|
3 /* Info */,
|
||||||
coreViewModel2.translations.settings.pages.info
|
coreViewModel2.translations.settings.pages.info
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -7487,7 +7565,7 @@
|
|||||||
function SettingsInfoPane(coreViewModel2, settingsViewModel2) {
|
function SettingsInfoPane(coreViewModel2, settingsViewModel2) {
|
||||||
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.homePage.appName), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("div", { class: "flex-column gap" }, InfoTile(
|
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.homePage.appName), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("div", { class: "flex-column gap" }, InfoTile(
|
||||||
"build",
|
"build",
|
||||||
coreViewModel2.translations.settings.version,
|
coreViewModel2.translations.settings.about.version,
|
||||||
settingsViewModel2.coreViewModel.version
|
settingsViewModel2.coreViewModel.version
|
||||||
), /* @__PURE__ */ createElement(
|
), /* @__PURE__ */ createElement(
|
||||||
"button",
|
"button",
|
||||||
@@ -7498,15 +7576,15 @@
|
|||||||
},
|
},
|
||||||
/* @__PURE__ */ createElement("span", { "subscribe:innerText": coreViewModel2.updateText }),
|
/* @__PURE__ */ createElement("span", { "subscribe:innerText": coreViewModel2.updateText }),
|
||||||
/* @__PURE__ */ createElement("span", { class: "icon" }, "update")
|
/* @__PURE__ */ createElement("span", { class: "icon" }, "update")
|
||||||
), /* @__PURE__ */ createElement("button", { class: "standard", "on:click": coreViewModel2.checkUpdates }, coreViewModel2.translations.settings.checkUpdatesButton)));
|
), /* @__PURE__ */ createElement("button", { class: "standard", "on:click": coreViewModel2.checkUpdates }, coreViewModel2.translations.settings.about.checkUpdatesButton)));
|
||||||
}
|
}
|
||||||
function SettingsRegionalPane(coreViewModel2, settingsViewModel2) {
|
function SettingsRegionalPane(coreViewModel2, settingsViewModel2) {
|
||||||
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.settings.pages.regional), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("h3", null, coreViewModel2.translations.settings.language), OptionButtonList(
|
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.settings.pages.regional), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("h3", null, coreViewModel2.translations.settings.regional.language), OptionButtonList(
|
||||||
new ListState(
|
new ListState(
|
||||||
Object.values(Languages).map((x) => [languageNames[x], x])
|
Object.values(Languages).map((x) => [languageNames[x], x])
|
||||||
),
|
),
|
||||||
settingsViewModel2.language
|
settingsViewModel2.language
|
||||||
), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("h3", null, coreViewModel2.translations.settings.firstDayOfWeekLabel), OptionButtonList(
|
), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("h3", null, coreViewModel2.translations.settings.regional.firstDayOfWeekLabel), OptionButtonList(
|
||||||
new ListState(
|
new ListState(
|
||||||
coreViewModel2.translations.regional.weekdays.full.map(
|
coreViewModel2.translations.regional.weekdays.full.map(
|
||||||
(x, i) => [x, i.toString()]
|
(x, i) => [x, i.toString()]
|
||||||
@@ -7515,6 +7593,26 @@
|
|||||||
settingsViewModel2.firstDayOfWeek
|
settingsViewModel2.firstDayOfWeek
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
function SettingsAccountPane(coreViewModel2, settingsViewModel2) {
|
||||||
|
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.settings.pages.account), /* @__PURE__ */ createElement("hr", null), /* @__PURE__ */ createElement("label", { class: "tile flex-no" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "account_circle"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", null, coreViewModel2.translations.settings.account.yourNameLabel), /* @__PURE__ */ createElement(
|
||||||
|
"input",
|
||||||
|
{
|
||||||
|
placeholder: coreViewModel2.translations.settings.account.yourNamePlaceholder,
|
||||||
|
"bind:value": settingsViewModel2.usernameInput,
|
||||||
|
"on:enter": settingsViewModel2.setName
|
||||||
|
}
|
||||||
|
))), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end width-input" }, /* @__PURE__ */ createElement(
|
||||||
|
"button",
|
||||||
|
{
|
||||||
|
class: "width-50",
|
||||||
|
"on:click": settingsViewModel2.setName,
|
||||||
|
"toggle:disabled": settingsViewModel2.cannotSetName,
|
||||||
|
"aria-label": coreViewModel2.translations.settings.account.setNameButtonAudioLabel
|
||||||
|
},
|
||||||
|
coreViewModel2.translations.general.setButton,
|
||||||
|
/* @__PURE__ */ createElement("span", { class: "icon" }, "check")
|
||||||
|
)));
|
||||||
|
}
|
||||||
function SettingsAppearancePane(coreViewModel2, settingsViewModel2) {
|
function SettingsAppearancePane(coreViewModel2, settingsViewModel2) {
|
||||||
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.settings.pages.appearance), /* @__PURE__ */ createElement("hr", null), OptionButtonList(
|
return /* @__PURE__ */ createElement("div", { class: "slide-up" }, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.settings.pages.appearance), /* @__PURE__ */ createElement("hr", null), OptionButtonList(
|
||||||
new ListState([
|
new ListState([
|
||||||
@@ -8150,6 +8248,37 @@
|
|||||||
body: ""
|
body: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// src/Model/Global/contactListModel.ts
|
||||||
|
var ContactListModel = class {
|
||||||
|
constructor(storageModel2, settingsModel2) {
|
||||||
|
this.storageModel = storageModel2;
|
||||||
|
this.settingsModel = settingsModel2;
|
||||||
|
this.contactHandlerManager = new HandlerManager();
|
||||||
|
this.getContactPath = (contactId) => {
|
||||||
|
return StorageModel.getPath("contacts" /* ContactsModel */, [
|
||||||
|
contactId
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
this.loadContacts = () => {
|
||||||
|
const contactIds = this.storageModel.list([
|
||||||
|
"contacts" /* ContactsModel */
|
||||||
|
]);
|
||||||
|
const contacts = contactIds.map((id) => [
|
||||||
|
id,
|
||||||
|
this.storageModel.read(this.getContactPath(id)) ?? "?"
|
||||||
|
]);
|
||||||
|
contacts.push([this.settingsModel.userid, this.settingsModel.username]);
|
||||||
|
return contacts;
|
||||||
|
};
|
||||||
|
this.storeContact = (id, name) => {
|
||||||
|
this.contactHandlerManager.trigger([id, name]);
|
||||||
|
if (id == this.settingsModel.userid) return;
|
||||||
|
const path = this.getContactPath(id);
|
||||||
|
this.storageModel.write(path, name);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// node_modules/udn-frontend/index.ts
|
// node_modules/udn-frontend/index.ts
|
||||||
var UDNFrontend = class {
|
var UDNFrontend = class {
|
||||||
ws;
|
ws;
|
||||||
@@ -8370,11 +8499,17 @@
|
|||||||
return chatMessages;
|
return chatMessages;
|
||||||
};
|
};
|
||||||
this.addToOutbox = (chatMessage) => {
|
this.addToOutbox = (chatMessage) => {
|
||||||
const messagePath = [...this.getOutboxPath(), chatMessage.fileId];
|
const messagePath = [
|
||||||
|
...this.getOutboxPath(),
|
||||||
|
chatMessage.fileId
|
||||||
|
];
|
||||||
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
||||||
};
|
};
|
||||||
this.removeFromOutbox = (chatMessage) => {
|
this.removeFromOutbox = (chatMessage) => {
|
||||||
const messagePath = [...this.getOutboxPath(), chatMessage.fileId];
|
const messagePath = [
|
||||||
|
...this.getOutboxPath(),
|
||||||
|
chatMessage.fileId
|
||||||
|
];
|
||||||
this.storageModel.remove(messagePath);
|
this.storageModel.remove(messagePath);
|
||||||
};
|
};
|
||||||
this.sendMessagesInOutbox = () => {
|
this.sendMessagesInOutbox = () => {
|
||||||
@@ -8564,79 +8699,10 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/Model/Global/contactListModel.ts
|
|
||||||
var ContactListModel = class {
|
|
||||||
constructor(storageModel2) {
|
|
||||||
this.storageModel = storageModel2;
|
|
||||||
this.contactHandlerManager = new HandlerManager();
|
|
||||||
this.getContactPath = (contactId) => {
|
|
||||||
return StorageModel.getPath("contacts" /* ContactsModel */, [contactId]);
|
|
||||||
};
|
|
||||||
this.loadContacts = () => {
|
|
||||||
const contactIds = this.storageModel.list(["contacts" /* ContactsModel */]);
|
|
||||||
const contacts = contactIds.map((id) => [id, this.storageModel.read(this.getContactPath(id)) ?? "?"]);
|
|
||||||
return contacts;
|
|
||||||
};
|
|
||||||
this.storeContact = (id, name) => {
|
|
||||||
const path = this.getContactPath(id);
|
|
||||||
this.storageModel.write(path, name);
|
|
||||||
this.contactHandlerManager.trigger([id, name]);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// src/ViewModel/Global/contactViewModel.ts
|
|
||||||
var ContactListViewModel = class {
|
|
||||||
// init
|
|
||||||
constructor(contactListModel2) {
|
|
||||||
this.contactListModel = contactListModel2;
|
|
||||||
// state
|
|
||||||
this.contacts = /* @__PURE__ */ new Map();
|
|
||||||
// main
|
|
||||||
this.updateContact = (id, name) => {
|
|
||||||
const match = this.contacts.get(id);
|
|
||||||
if (match) {
|
|
||||||
match.name.value = name;
|
|
||||||
return match;
|
|
||||||
}
|
|
||||||
const vm = new ContactViewModel(id, name);
|
|
||||||
this.contacts.set(id, vm);
|
|
||||||
return vm;
|
|
||||||
};
|
|
||||||
this.handleContact = (contact) => {
|
|
||||||
this.updateContact(...contact);
|
|
||||||
};
|
|
||||||
this.unwrapContact = (id, knownName) => {
|
|
||||||
if (this.contacts.has(id))
|
|
||||||
return this.contacts.get(id);
|
|
||||||
return this.updateContact(id, knownName);
|
|
||||||
};
|
|
||||||
// load
|
|
||||||
this.loadData = () => {
|
|
||||||
const contacts = this.contactListModel.loadContacts();
|
|
||||||
for (const contact of contacts) {
|
|
||||||
const vm = new ContactViewModel(...contact);
|
|
||||||
this.contacts.set(vm.id, vm);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.loadData();
|
|
||||||
this.contactListModel.contactHandlerManager.setHandler("contact-list-view-model", this.handleContact);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var ContactViewModel = class {
|
|
||||||
// init
|
|
||||||
constructor(id, name) {
|
|
||||||
this.id = id;
|
|
||||||
// state
|
|
||||||
this.name = new State("");
|
|
||||||
this.name.value = name;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// src/index.tsx
|
// src/index.tsx
|
||||||
var storageModel = new StorageModel();
|
var storageModel = new StorageModel();
|
||||||
var contactListModel = new ContactListModel(storageModel);
|
var settingsModel = new SettingsModel(storageModel);
|
||||||
var settingsModel = new SettingsModel(storageModel, contactListModel);
|
var contactListModel = new ContactListModel(storageModel, settingsModel);
|
||||||
var connectionModel = new ConnectionModel(storageModel);
|
var connectionModel = new ConnectionModel(storageModel);
|
||||||
var chatListModel = new ChatListModel(
|
var chatListModel = new ChatListModel(
|
||||||
storageModel,
|
storageModel,
|
||||||
@@ -8653,8 +8719,11 @@
|
|||||||
fileTransferModel
|
fileTransferModel
|
||||||
);
|
);
|
||||||
var storageViewModel = new StorageViewModel(coreViewModel);
|
var storageViewModel = new StorageViewModel(coreViewModel);
|
||||||
var contactListViewModel = new ContactListViewModel(contactListModel);
|
|
||||||
var settingsViewModel = new SettingsViewModel(coreViewModel, settingsModel);
|
var settingsViewModel = new SettingsViewModel(coreViewModel, settingsModel);
|
||||||
|
var contactListViewModel = new ContactListViewModel(
|
||||||
|
contactListModel,
|
||||||
|
settingsViewModel
|
||||||
|
);
|
||||||
var connectionViewModel = new ConnectionViewModel(coreViewModel);
|
var connectionViewModel = new ConnectionViewModel(coreViewModel);
|
||||||
var chatListViewModel = new ChatListViewModel(
|
var chatListViewModel = new ChatListViewModel(
|
||||||
coreViewModel,
|
coreViewModel,
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
const VERSION = "2610 Beta 14"
|
const VERSION = "2610 Beta 16"
|
||||||
|
|
||||||
function processUrl(event) {
|
function processUrl(event) {
|
||||||
const url = event.request.url;
|
const url = event.request.url;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
2610 Beta 14
|
2610 Beta 16
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import StorageModel, {
|
|||||||
filePaths,
|
filePaths,
|
||||||
} from "../Global/storageModel";
|
} from "../Global/storageModel";
|
||||||
import SettingsModel from "../Global/settingsModel";
|
import SettingsModel from "../Global/settingsModel";
|
||||||
import ConnectionModel from "../Global/connectionModel";
|
|
||||||
import ContactListModel from "../Global/contactListModel";
|
import ContactListModel from "../Global/contactListModel";
|
||||||
|
import ConnectionModel from "../Global/connectionModel";
|
||||||
|
|
||||||
export default class ChatListModel {
|
export default class ChatListModel {
|
||||||
// data
|
// data
|
||||||
@@ -102,7 +102,7 @@ export default class ChatListModel {
|
|||||||
public storageModel: StorageModel,
|
public storageModel: StorageModel,
|
||||||
public settingsModel: SettingsModel,
|
public settingsModel: SettingsModel,
|
||||||
public connectionModel: ConnectionModel,
|
public connectionModel: ConnectionModel,
|
||||||
public contactListModel: ContactListModel
|
public contactListModel: ContactListModel,
|
||||||
) {
|
) {
|
||||||
this.loadChats();
|
this.loadChats();
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ import StorageModel, {
|
|||||||
filePaths,
|
filePaths,
|
||||||
} from "../Global/storageModel";
|
} from "../Global/storageModel";
|
||||||
import SettingsModel from "../Global/settingsModel";
|
import SettingsModel from "../Global/settingsModel";
|
||||||
|
import ContactListModel from "../Global/contactListModel";
|
||||||
import ConnectionModel from "../Global/connectionModel";
|
import ConnectionModel from "../Global/connectionModel";
|
||||||
import FileModel, { FileContent } from "../Files/fileModel";
|
import FileModel, { FileContent } from "../Files/fileModel";
|
||||||
import { Colors } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import ContactListModel from "../Global/contactListModel";
|
|
||||||
|
|
||||||
export default class ChatModel {
|
export default class ChatModel {
|
||||||
// models
|
// models
|
||||||
@@ -162,11 +162,16 @@ export default class ChatModel {
|
|||||||
readonly addMessage = async (chatMessage: ChatMessage): Promise<void> => {
|
readonly addMessage = async (chatMessage: ChatMessage): Promise<void> => {
|
||||||
await this.decryptMessage(chatMessage);
|
await this.decryptMessage(chatMessage);
|
||||||
|
|
||||||
this.contactListModel.storeContact(chatMessage.senderId, chatMessage.senderName);
|
this.contactListModel.storeContact(
|
||||||
|
chatMessage.senderId,
|
||||||
|
chatMessage.senderName,
|
||||||
|
);
|
||||||
|
|
||||||
// message
|
// message
|
||||||
if (chatMessage.body != "") {
|
if (chatMessage.body != "") {
|
||||||
const messagePath: string[] = this.getMessagePath(chatMessage.fileId);
|
const messagePath: string[] = this.getMessagePath(
|
||||||
|
chatMessage.fileId,
|
||||||
|
);
|
||||||
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
||||||
this.chatMessageHandlerManager.trigger(chatMessage);
|
this.chatMessageHandlerManager.trigger(chatMessage);
|
||||||
}
|
}
|
||||||
@@ -501,8 +506,7 @@ export interface ChatMessage extends FileContent<"message"> {
|
|||||||
stringifiedFile: string;
|
stringifiedFile: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChatMessageReaction
|
export interface ChatMessageReaction extends FileContent<"reaction"> {
|
||||||
extends FileContent<"reaction"> {
|
|
||||||
readonly messageId: string;
|
readonly messageId: string;
|
||||||
readonly senderId: string;
|
readonly senderId: string;
|
||||||
readonly senderName: string;
|
readonly senderName: string;
|
||||||
|
|||||||
@@ -149,12 +149,18 @@ export default class ConnectionModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly addToOutbox = (chatMessage: ChatMessage): void => {
|
readonly addToOutbox = (chatMessage: ChatMessage): void => {
|
||||||
const messagePath: string[] = [...this.getOutboxPath(), chatMessage.fileId];
|
const messagePath: string[] = [
|
||||||
|
...this.getOutboxPath(),
|
||||||
|
chatMessage.fileId,
|
||||||
|
];
|
||||||
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
this.storageModel.writeStringifiable(messagePath, chatMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly removeFromOutbox = (chatMessage: ChatMessage): void => {
|
readonly removeFromOutbox = (chatMessage: ChatMessage): void => {
|
||||||
const messagePath: string[] = [...this.getOutboxPath(), chatMessage.fileId];
|
const messagePath: string[] = [
|
||||||
|
...this.getOutboxPath(),
|
||||||
|
chatMessage.fileId,
|
||||||
|
];
|
||||||
this.storageModel.remove(messagePath);
|
this.storageModel.remove(messagePath);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,38 @@
|
|||||||
import {HandlerManager} from "../Utility/utility";
|
|
||||||
import SettingsModel from "./settingsModel";
|
|
||||||
import StorageModel, { StorageModelSubPaths } from "./storageModel";
|
import StorageModel, { StorageModelSubPaths } from "./storageModel";
|
||||||
|
import SettingsModel from "./settingsModel";
|
||||||
|
import { HandlerManager } from "../Utility/utility";
|
||||||
|
|
||||||
export default class ContactListModel {
|
export default class ContactListModel {
|
||||||
contactHandlerManager = new HandlerManager<[string, string]>();
|
contactHandlerManager = new HandlerManager<[string, string]>();
|
||||||
|
|
||||||
private getContactPath = (contactId: string): string[] => {
|
private getContactPath = (contactId: string): string[] => {
|
||||||
return StorageModel.getPath(StorageModelSubPaths.ContactsModel, [contactId]);
|
return StorageModel.getPath(StorageModelSubPaths.ContactsModel, [
|
||||||
}
|
contactId,
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
loadContacts = (): [string, string][] => {
|
loadContacts = (): [string, string][] => {
|
||||||
const contactIds: string[] = this.storageModel.list([StorageModelSubPaths.ContactsModel]);
|
const contactIds: string[] = this.storageModel.list([
|
||||||
const contacts: [string, string][] = contactIds.map(id => [id, this.storageModel.read(this.getContactPath(id)) ?? "?"]);
|
StorageModelSubPaths.ContactsModel,
|
||||||
|
]);
|
||||||
|
const contacts: [string, string][] = contactIds.map((id) => [
|
||||||
|
id,
|
||||||
|
this.storageModel.read(this.getContactPath(id)) ?? "?",
|
||||||
|
]);
|
||||||
contacts.push([this.settingsModel.userid, this.settingsModel.username]);
|
contacts.push([this.settingsModel.userid, this.settingsModel.username]);
|
||||||
return contacts;
|
return contacts;
|
||||||
}
|
};
|
||||||
|
|
||||||
storeContact = (id: string, name: string) => {
|
storeContact = (id: string, name: string) => {
|
||||||
this.contactHandlerManager.trigger([id, name]);
|
this.contactHandlerManager.trigger([id, name]);
|
||||||
|
|
||||||
if (id == this.settingsModel.userid) return;
|
if (id == this.settingsModel.userid) return;
|
||||||
const path = this.getContactPath(id);
|
const path = this.getContactPath(id);
|
||||||
this.storageModel.write(path, name)
|
this.storageModel.write(path, name);
|
||||||
}
|
};
|
||||||
|
|
||||||
constructor(public storageModel: StorageModel, public settingsModel: SettingsModel) {}
|
constructor(
|
||||||
|
public storageModel: StorageModel,
|
||||||
|
public settingsModel: SettingsModel,
|
||||||
|
) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ export default class StorageModel {
|
|||||||
// upgrade
|
// upgrade
|
||||||
readonly upgrade = (): void => {
|
readonly upgrade = (): void => {
|
||||||
// function used to upgrade data versions
|
// function used to upgrade data versions
|
||||||
}
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ViewController } from "../viewController";
|
import { ViewController } from "../viewController";
|
||||||
import * as React from "../../react";
|
import * as React from "../../react";
|
||||||
import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel";
|
|
||||||
import { ContactViewModel } from "../../ViewModel/Global/contactViewModel";
|
import { ContactViewModel } from "../../ViewModel/Global/contactViewModel";
|
||||||
|
import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel";
|
||||||
|
|
||||||
export function InlineReply(chatMessageViewModel: ChatMessageViewModel) {
|
export function InlineReply(chatMessageViewModel: ChatMessageViewModel) {
|
||||||
const reply = chatMessageViewModel.inlineReply;
|
const reply = chatMessageViewModel.inlineReply;
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ export function ReplyPreview(
|
|||||||
return (
|
return (
|
||||||
<div class="reply-preview">
|
<div class="reply-preview">
|
||||||
<div class="surface blur">
|
<div class="surface blur">
|
||||||
<span class="secondary" subscribe:innerText={chatMessageViewModel.contact.name}></span>
|
<span
|
||||||
|
class="secondary"
|
||||||
|
subscribe:innerText={chatMessageViewModel.contact.name}
|
||||||
|
></span>
|
||||||
<b
|
<b
|
||||||
class="ellipsis"
|
class="ellipsis"
|
||||||
subscribe:innerText={chatMessageViewModel.body}
|
subscribe:innerText={chatMessageViewModel.body}
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ export function SettingsModal(
|
|||||||
coreViewModel,
|
coreViewModel,
|
||||||
settingsViewModel,
|
settingsViewModel,
|
||||||
);
|
);
|
||||||
|
case SettingsModalPages.Account:
|
||||||
|
return SettingsAccountPane(
|
||||||
|
coreViewModel,
|
||||||
|
settingsViewModel,
|
||||||
|
);
|
||||||
case SettingsModalPages.Regional:
|
case SettingsModalPages.Regional:
|
||||||
return SettingsRegionalPane(
|
return SettingsRegionalPane(
|
||||||
coreViewModel,
|
coreViewModel,
|
||||||
@@ -79,6 +84,12 @@ function SettingsLeftPane(
|
|||||||
SettingsModalPages.Appearance,
|
SettingsModalPages.Appearance,
|
||||||
coreViewModel.translations.settings.pages.appearance,
|
coreViewModel.translations.settings.pages.appearance,
|
||||||
)}
|
)}
|
||||||
|
{SettingsPaneButton(
|
||||||
|
coreViewModel,
|
||||||
|
settingsViewModel,
|
||||||
|
SettingsModalPages.Account,
|
||||||
|
coreViewModel.translations.settings.pages.account,
|
||||||
|
)}
|
||||||
{SettingsPaneButton(
|
{SettingsPaneButton(
|
||||||
coreViewModel,
|
coreViewModel,
|
||||||
settingsViewModel,
|
settingsViewModel,
|
||||||
@@ -121,7 +132,7 @@ function SettingsInfoPane(
|
|||||||
<div class="flex-column gap">
|
<div class="flex-column gap">
|
||||||
{InfoTile(
|
{InfoTile(
|
||||||
"build",
|
"build",
|
||||||
coreViewModel.translations.settings.version,
|
coreViewModel.translations.settings.about.version,
|
||||||
settingsViewModel.coreViewModel.version,
|
settingsViewModel.coreViewModel.version,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -135,7 +146,10 @@ function SettingsInfoPane(
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="standard" on:click={coreViewModel.checkUpdates}>
|
<button class="standard" on:click={coreViewModel.checkUpdates}>
|
||||||
{coreViewModel.translations.settings.checkUpdatesButton}
|
{
|
||||||
|
coreViewModel.translations.settings.about
|
||||||
|
.checkUpdatesButton
|
||||||
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -151,7 +165,7 @@ function SettingsRegionalPane(
|
|||||||
<h2>{coreViewModel.translations.settings.pages.regional}</h2>
|
<h2>{coreViewModel.translations.settings.pages.regional}</h2>
|
||||||
|
|
||||||
<hr></hr>
|
<hr></hr>
|
||||||
<h3>{coreViewModel.translations.settings.language}</h3>
|
<h3>{coreViewModel.translations.settings.regional.language}</h3>
|
||||||
{OptionButtonList(
|
{OptionButtonList(
|
||||||
new React.ListState<[string, string]>(
|
new React.ListState<[string, string]>(
|
||||||
Object.values(Languages).map((x) => [languageNames[x], x]),
|
Object.values(Languages).map((x) => [languageNames[x], x]),
|
||||||
@@ -160,7 +174,12 @@ function SettingsRegionalPane(
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<hr></hr>
|
<hr></hr>
|
||||||
<h3>{coreViewModel.translations.settings.firstDayOfWeekLabel}</h3>
|
<h3>
|
||||||
|
{
|
||||||
|
coreViewModel.translations.settings.regional
|
||||||
|
.firstDayOfWeekLabel
|
||||||
|
}
|
||||||
|
</h3>
|
||||||
{OptionButtonList(
|
{OptionButtonList(
|
||||||
new React.ListState<[string, string]>(
|
new React.ListState<[string, string]>(
|
||||||
coreViewModel.translations.regional.weekdays.full.map(
|
coreViewModel.translations.regional.weekdays.full.map(
|
||||||
@@ -173,6 +192,51 @@ function SettingsRegionalPane(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SettingsAccountPane(
|
||||||
|
coreViewModel: CoreViewModel,
|
||||||
|
settingsViewModel: SettingsViewModel,
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<div class="slide-up">
|
||||||
|
<h2>{coreViewModel.translations.settings.pages.account}</h2>
|
||||||
|
<hr></hr>
|
||||||
|
<label class="tile flex-no">
|
||||||
|
<span class="icon">account_circle</span>
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
coreViewModel.translations.settings.account
|
||||||
|
.yourNameLabel
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
<input
|
||||||
|
placeholder={
|
||||||
|
coreViewModel.translations.settings.account
|
||||||
|
.yourNamePlaceholder
|
||||||
|
}
|
||||||
|
bind:value={settingsViewModel.usernameInput}
|
||||||
|
on:enter={settingsViewModel.setName}
|
||||||
|
></input>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
<div class="flex-row justify-end width-input">
|
||||||
|
<button
|
||||||
|
class="width-50"
|
||||||
|
on:click={settingsViewModel.setName}
|
||||||
|
toggle:disabled={settingsViewModel.cannotSetName}
|
||||||
|
aria-label={
|
||||||
|
coreViewModel.translations.settings.account
|
||||||
|
.setNameButtonAudioLabel
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{coreViewModel.translations.general.setButton}
|
||||||
|
<span class="icon">check</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function SettingsAppearancePane(
|
function SettingsAppearancePane(
|
||||||
coreViewModel: CoreViewModel,
|
coreViewModel: CoreViewModel,
|
||||||
settingsViewModel: SettingsViewModel,
|
settingsViewModel: SettingsViewModel,
|
||||||
|
|||||||
@@ -87,39 +87,6 @@ export function HomePage(
|
|||||||
|
|
||||||
<hr></hr>
|
<hr></hr>
|
||||||
|
|
||||||
<label class="tile flex-no">
|
|
||||||
<span class="icon">account_circle</span>
|
|
||||||
<div>
|
|
||||||
<span>
|
|
||||||
{coreViewModel.translations.homePage.yourNameLabel}
|
|
||||||
</span>
|
|
||||||
<input
|
|
||||||
placeholder={
|
|
||||||
coreViewModel.translations.homePage
|
|
||||||
.yourNamePlaceholder
|
|
||||||
}
|
|
||||||
bind:value={settingsViewModel.usernameInput}
|
|
||||||
on:enter={settingsViewModel.setName}
|
|
||||||
></input>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<div class="flex-row justify-end">
|
|
||||||
<button
|
|
||||||
class="width-50"
|
|
||||||
on:click={settingsViewModel.setName}
|
|
||||||
toggle:disabled={settingsViewModel.cannotSetName}
|
|
||||||
aria-label={
|
|
||||||
coreViewModel.translations.homePage
|
|
||||||
.setNameButtonAudioLabel
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{coreViewModel.translations.general.setButton}
|
|
||||||
<span class="icon">check</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr></hr>
|
|
||||||
|
|
||||||
{HomePageButton(
|
{HomePageButton(
|
||||||
settingsViewModel.showSettingsModal,
|
settingsViewModel.showSettingsModal,
|
||||||
coreViewModel.translations.homePage.settingsButton,
|
coreViewModel.translations.homePage.settingsButton,
|
||||||
|
|||||||
+35
-26
@@ -65,10 +65,6 @@ const englishTranslations = {
|
|||||||
disconnectAudioLabel: "disconnect from server",
|
disconnectAudioLabel: "disconnect from server",
|
||||||
manageConnectionsAudioLabel: "manage connections",
|
manageConnectionsAudioLabel: "manage connections",
|
||||||
|
|
||||||
yourNameLabel: "Your name",
|
|
||||||
yourNamePlaceholder: "Jane Doe",
|
|
||||||
setNameButtonAudioLabel: "set name",
|
|
||||||
|
|
||||||
settingsButton: "Settings",
|
settingsButton: "Settings",
|
||||||
manageStorageButton: "Manage storage",
|
manageStorageButton: "Manage storage",
|
||||||
transferDataButton: "Transfer or export data",
|
transferDataButton: "Transfer or export data",
|
||||||
@@ -90,6 +86,7 @@ const englishTranslations = {
|
|||||||
settings: {
|
settings: {
|
||||||
pages: {
|
pages: {
|
||||||
appearance: "Appearance",
|
appearance: "Appearance",
|
||||||
|
account: "Account",
|
||||||
regional: "Language & Region",
|
regional: "Language & Region",
|
||||||
info: "About CT",
|
info: "About CT",
|
||||||
},
|
},
|
||||||
@@ -100,14 +97,20 @@ const englishTranslations = {
|
|||||||
system: "Device theme",
|
system: "Device theme",
|
||||||
black: "Black",
|
black: "Black",
|
||||||
},
|
},
|
||||||
|
account: {
|
||||||
version: "Version",
|
yourNameLabel: "Your name",
|
||||||
|
yourNamePlaceholder: "Jane Doe",
|
||||||
|
setNameButtonAudioLabel: "set name",
|
||||||
|
},
|
||||||
|
regional: {
|
||||||
language: "Language",
|
language: "Language",
|
||||||
|
|
||||||
firstDayOfWeekLabel: "First day of week",
|
firstDayOfWeekLabel: "First day of week",
|
||||||
|
},
|
||||||
|
about: {
|
||||||
|
version: "Version",
|
||||||
checkUpdatesButton: "Check for updates",
|
checkUpdatesButton: "Check for updates",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
connectionModal: {
|
connectionModal: {
|
||||||
connectionModalHeadline: "Manage Connections",
|
connectionModalHeadline: "Manage Connections",
|
||||||
@@ -414,10 +417,6 @@ export const allTranslations: {
|
|||||||
disconnectAudioLabel: "vom Server trennen",
|
disconnectAudioLabel: "vom Server trennen",
|
||||||
manageConnectionsAudioLabel: "Verbindungen verwalten",
|
manageConnectionsAudioLabel: "Verbindungen verwalten",
|
||||||
|
|
||||||
yourNameLabel: "Dein Name",
|
|
||||||
yourNamePlaceholder: "Max Mustermann",
|
|
||||||
setNameButtonAudioLabel: "Name speichern",
|
|
||||||
|
|
||||||
settingsButton: "Einstellungen",
|
settingsButton: "Einstellungen",
|
||||||
manageStorageButton: "Daten verwalten",
|
manageStorageButton: "Daten verwalten",
|
||||||
transferDataButton: "Daten übertragen",
|
transferDataButton: "Daten übertragen",
|
||||||
@@ -437,6 +436,7 @@ export const allTranslations: {
|
|||||||
settings: {
|
settings: {
|
||||||
pages: {
|
pages: {
|
||||||
appearance: "Erscheinungsbild",
|
appearance: "Erscheinungsbild",
|
||||||
|
account: "Konto",
|
||||||
regional: "Sprache & Region",
|
regional: "Sprache & Region",
|
||||||
info: "Über CT",
|
info: "Über CT",
|
||||||
},
|
},
|
||||||
@@ -447,13 +447,19 @@ export const allTranslations: {
|
|||||||
system: "Geräteeinstellung",
|
system: "Geräteeinstellung",
|
||||||
black: "Schwarz",
|
black: "Schwarz",
|
||||||
},
|
},
|
||||||
|
account: {
|
||||||
version: "Version",
|
yourNameLabel: "Dein Name",
|
||||||
|
yourNamePlaceholder: "Max Mustermann",
|
||||||
|
setNameButtonAudioLabel: "Namen festlegen",
|
||||||
|
},
|
||||||
|
regional: {
|
||||||
language: "Sprache",
|
language: "Sprache",
|
||||||
|
|
||||||
firstDayOfWeekLabel: "Erster Wochentag",
|
firstDayOfWeekLabel: "Erster Wochentag",
|
||||||
|
},
|
||||||
checkUpdatesButton: "Nach updates suchen",
|
about: {
|
||||||
|
version: "Version",
|
||||||
|
checkUpdatesButton: "Nach Updates suchen",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
connectionModal: {
|
connectionModal: {
|
||||||
@@ -729,10 +735,6 @@ export const allTranslations: {
|
|||||||
disconnectAudioLabel: "desconectar del servidor",
|
disconnectAudioLabel: "desconectar del servidor",
|
||||||
manageConnectionsAudioLabel: "gestionar conexiones",
|
manageConnectionsAudioLabel: "gestionar conexiones",
|
||||||
|
|
||||||
yourNameLabel: "Tu nombre",
|
|
||||||
yourNamePlaceholder: "Juan Pérez",
|
|
||||||
setNameButtonAudioLabel: "establecer nombre",
|
|
||||||
|
|
||||||
settingsButton: "Ajustes",
|
settingsButton: "Ajustes",
|
||||||
manageStorageButton: "Gestionar almacenamiento",
|
manageStorageButton: "Gestionar almacenamiento",
|
||||||
transferDataButton: "Enviar o exportar archivos",
|
transferDataButton: "Enviar o exportar archivos",
|
||||||
@@ -752,6 +754,7 @@ export const allTranslations: {
|
|||||||
settings: {
|
settings: {
|
||||||
pages: {
|
pages: {
|
||||||
appearance: "Aspecto",
|
appearance: "Aspecto",
|
||||||
|
account: "Cuenta",
|
||||||
regional: "Idioma y Región",
|
regional: "Idioma y Región",
|
||||||
info: "Sobre CT",
|
info: "Sobre CT",
|
||||||
},
|
},
|
||||||
@@ -762,13 +765,19 @@ export const allTranslations: {
|
|||||||
system: "Según dispositivo",
|
system: "Según dispositivo",
|
||||||
black: "Negro",
|
black: "Negro",
|
||||||
},
|
},
|
||||||
|
account: {
|
||||||
version: "Versión",
|
yourNameLabel: "Tu nombre",
|
||||||
|
yourNamePlaceholder: "Juan Pérez",
|
||||||
|
setNameButtonAudioLabel: "establecer nombre",
|
||||||
|
},
|
||||||
|
regional: {
|
||||||
language: "Idioma",
|
language: "Idioma",
|
||||||
|
|
||||||
firstDayOfWeekLabel: "Primer día de la semana",
|
firstDayOfWeekLabel: "Primer día de la semana",
|
||||||
|
},
|
||||||
checkUpdatesButton: "Buscar actualizaciones",
|
about: {
|
||||||
|
version: "Versión",
|
||||||
|
checkUpdatesButton: "Buscar actualisaciones",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
connectionModal: {
|
connectionModal: {
|
||||||
connectionModalHeadline: "Gestionar Conexiones",
|
connectionModalHeadline: "Gestionar Conexiones",
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import ChatViewModel from "./chatViewModel";
|
|||||||
import SettingsViewModel from "../Global/settingsViewModel";
|
import SettingsViewModel from "../Global/settingsViewModel";
|
||||||
import NotificationViewModel from "../Global/notificationViewModel";
|
import NotificationViewModel from "../Global/notificationViewModel";
|
||||||
import CoreViewModel from "../Global/coreViewModel";
|
import CoreViewModel from "../Global/coreViewModel";
|
||||||
|
import ContactListViewModel from "../Global/contactViewModel";
|
||||||
import ConnectionViewModel from "../Global/connectionViewModel";
|
import ConnectionViewModel from "../Global/connectionViewModel";
|
||||||
import * as React from "../../react";
|
import * as React from "../../react";
|
||||||
import { IndexManager } from "../../Model/Utility/utility";
|
import { IndexManager } from "../../Model/Utility/utility";
|
||||||
import ChatModel from "../../Model/Chat/chatModel";
|
import ChatModel from "../../Model/Chat/chatModel";
|
||||||
import ContactListViewModel from "../Global/contactViewModel";
|
|
||||||
|
|
||||||
export default class ChatListViewModel {
|
export default class ChatListViewModel {
|
||||||
notificationViewModel: NotificationViewModel;
|
notificationViewModel: NotificationViewModel;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import MessagePageViewModel from "../Pages/messagePageViewModel";
|
import MessagePageViewModel from "../Pages/messagePageViewModel";
|
||||||
import CoreViewModel from "../Global/coreViewModel";
|
import CoreViewModel from "../Global/coreViewModel";
|
||||||
|
import { ContactViewModel } from "../Global/contactViewModel";
|
||||||
import * as React from "../../react";
|
import * as React from "../../react";
|
||||||
import {
|
import {
|
||||||
ChatMessage,
|
ChatMessage,
|
||||||
@@ -7,7 +8,6 @@ import {
|
|||||||
ChatMessageStatuses,
|
ChatMessageStatuses,
|
||||||
ReactionSymbols,
|
ReactionSymbols,
|
||||||
} from "../../Model/Chat/chatModel";
|
} from "../../Model/Chat/chatModel";
|
||||||
import {ContactViewModel} from "../Global/contactViewModel";
|
|
||||||
|
|
||||||
export default class ChatMessageViewModel {
|
export default class ChatMessageViewModel {
|
||||||
// data
|
// data
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import CalendarPageViewModel, {
|
|||||||
import SettingsViewModel from "../Global/settingsViewModel";
|
import SettingsViewModel from "../Global/settingsViewModel";
|
||||||
import NotificationViewModel from "../Global/notificationViewModel";
|
import NotificationViewModel from "../Global/notificationViewModel";
|
||||||
import CoreViewModel, { Context, ContextHost } from "../Global/coreViewModel";
|
import CoreViewModel, { Context, ContextHost } from "../Global/coreViewModel";
|
||||||
|
import ContactListViewModel from "../Global/contactViewModel";
|
||||||
import ConnectionViewModel from "../Global/connectionViewModel";
|
import ConnectionViewModel from "../Global/connectionViewModel";
|
||||||
import * as React from "../../react";
|
import * as React from "../../react";
|
||||||
import { Colors } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
@@ -21,7 +22,6 @@ import ChatModel, {
|
|||||||
ChatMessage,
|
ChatMessage,
|
||||||
ChatMessageReaction,
|
ChatMessageReaction,
|
||||||
} from "../../Model/Chat/chatModel";
|
} from "../../Model/Chat/chatModel";
|
||||||
import ContactListViewModel from "../Global/contactViewModel";
|
|
||||||
|
|
||||||
export default class ChatViewModel extends ContextHost<ChatPageTypes> {
|
export default class ChatViewModel extends ContextHost<ChatPageTypes> {
|
||||||
calendarViewModel: CalendarPageViewModel;
|
calendarViewModel: CalendarPageViewModel;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import ContactListModel from "../../Model/Global/contactListModel";
|
|
||||||
import * as React from "../../react";
|
|
||||||
import SettingsViewModel from "./settingsViewModel";
|
import SettingsViewModel from "./settingsViewModel";
|
||||||
|
import * as React from "../../react";
|
||||||
|
import ContactListModel from "../../Model/Global/contactListModel";
|
||||||
|
|
||||||
export default class ContactListViewModel {
|
export default class ContactListViewModel {
|
||||||
// state
|
// state
|
||||||
@@ -20,31 +20,37 @@ export default class ContactListViewModel {
|
|||||||
const vm = new ContactViewModel(id, name);
|
const vm = new ContactViewModel(id, name);
|
||||||
this.contacts.set(id, vm);
|
this.contacts.set(id, vm);
|
||||||
return vm;
|
return vm;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleContact = (contact: [string, string]): void => {
|
handleContact = (contact: [string, string]): void => {
|
||||||
this.updateContact(...contact);
|
this.updateContact(...contact);
|
||||||
}
|
};
|
||||||
|
|
||||||
unwrapContact = (id: string, knownName: string): ContactViewModel => {
|
unwrapContact = (id: string, knownName: string): ContactViewModel => {
|
||||||
if (this.contacts.has(id))
|
if (this.contacts.has(id)) return this.contacts.get(id)!;
|
||||||
return this.contacts.get(id)!
|
|
||||||
return this.updateContact(id, knownName);
|
return this.updateContact(id, knownName);
|
||||||
}
|
};
|
||||||
|
|
||||||
// load
|
// load
|
||||||
loadData = (): void => {
|
loadData = (): void => {
|
||||||
const contacts: [string, string][] = this.contactListModel.loadContacts();
|
const contacts: [string, string][] =
|
||||||
|
this.contactListModel.loadContacts();
|
||||||
for (const contact of contacts) {
|
for (const contact of contacts) {
|
||||||
const vm = new ContactViewModel(...contact);
|
const vm = new ContactViewModel(...contact);
|
||||||
this.contacts.set(vm.id, vm);
|
this.contacts.set(vm.id, vm);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public contactListModel: ContactListModel, public settingsViewModel: SettingsViewModel) {
|
constructor(
|
||||||
|
public contactListModel: ContactListModel,
|
||||||
|
public settingsViewModel: SettingsViewModel,
|
||||||
|
) {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
this.contactListModel.contactHandlerManager.setHandler("contact-list-view-model", this.handleContact);
|
this.contactListModel.contactHandlerManager.setHandler(
|
||||||
|
"contact-list-view-model",
|
||||||
|
this.handleContact,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +59,10 @@ export class ContactViewModel {
|
|||||||
name: React.State<string> = new React.State("");
|
name: React.State<string> = new React.State("");
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public id: string, name: string) {
|
constructor(
|
||||||
|
public id: string,
|
||||||
|
name: string,
|
||||||
|
) {
|
||||||
this.name.value = name;
|
this.name.value = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import CoreViewModel, { Context } from "./coreViewModel";
|
import CoreViewModel, { Context } from "./coreViewModel";
|
||||||
import * as React from "../../react";
|
import * as React from "../../react";
|
||||||
import { CommonKeys } from "../../View/keystrokes";
|
import { CommonKeys } from "../../View/keystrokes";
|
||||||
import SettingsModel, { Languages, ThemeSettings } from "../../Model/Global/settingsModel";
|
import SettingsModel, {
|
||||||
|
Languages,
|
||||||
|
ThemeSettings,
|
||||||
|
} from "../../Model/Global/settingsModel";
|
||||||
|
|
||||||
export default class SettingsViewModel extends Context {
|
export default class SettingsViewModel extends Context {
|
||||||
// state
|
// state
|
||||||
@@ -129,7 +132,10 @@ export default class SettingsViewModel extends Context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public readonly coreViewModel: CoreViewModel, public readonly settingsModel: SettingsModel) {
|
constructor(
|
||||||
|
public readonly coreViewModel: CoreViewModel,
|
||||||
|
public readonly settingsModel: SettingsModel,
|
||||||
|
) {
|
||||||
super("settings");
|
super("settings");
|
||||||
|
|
||||||
this.username.value = coreViewModel.settingsModel.username;
|
this.username.value = coreViewModel.settingsModel.username;
|
||||||
@@ -177,6 +183,7 @@ export default class SettingsViewModel extends Context {
|
|||||||
|
|
||||||
export enum SettingsModalPages {
|
export enum SettingsModalPages {
|
||||||
Appearance,
|
Appearance,
|
||||||
|
Account,
|
||||||
Regional,
|
Regional,
|
||||||
Info,
|
Info,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import SearchViewModel from "../Utility/searchViewModel";
|
import SearchViewModel from "../Utility/searchViewModel";
|
||||||
import CoreViewModel, { Context } from "../Global/coreViewModel";
|
import CoreViewModel, { Context } from "../Global/coreViewModel";
|
||||||
|
import ContactListViewModel from "../Global/contactViewModel";
|
||||||
import ChatViewModel, { ChatPageTypes } from "../Chat/chatViewModel";
|
import ChatViewModel, { ChatPageTypes } from "../Chat/chatViewModel";
|
||||||
import ChatMessageViewModel from "../Chat/chatMessageViewModel";
|
import ChatMessageViewModel from "../Chat/chatMessageViewModel";
|
||||||
import * as React from "../../react";
|
import * as React from "../../react";
|
||||||
@@ -9,7 +10,6 @@ import {
|
|||||||
ChatMessageReaction,
|
ChatMessageReaction,
|
||||||
ReactionSymbols,
|
ReactionSymbols,
|
||||||
} from "../../Model/Chat/chatModel";
|
} from "../../Model/Chat/chatModel";
|
||||||
import ContactListViewModel from "../Global/contactViewModel";
|
|
||||||
|
|
||||||
export default class MessagePageViewModel extends Context {
|
export default class MessagePageViewModel extends Context {
|
||||||
// state
|
// state
|
||||||
@@ -107,14 +107,17 @@ export default class MessagePageViewModel extends Context {
|
|||||||
|
|
||||||
// view
|
// view
|
||||||
showChatMessage = (chatMessage: ChatMessage): void => {
|
showChatMessage = (chatMessage: ChatMessage): void => {
|
||||||
const contact = this.contactListViewModel.unwrapContact(chatMessage.senderId, chatMessage.senderName);
|
const contact = this.contactListViewModel.unwrapContact(
|
||||||
|
chatMessage.senderId,
|
||||||
|
chatMessage.senderName,
|
||||||
|
);
|
||||||
const chatMessageViewModel = new ChatMessageViewModel(
|
const chatMessageViewModel = new ChatMessageViewModel(
|
||||||
this.coreViewModel,
|
this.coreViewModel,
|
||||||
this,
|
this,
|
||||||
chatMessage,
|
chatMessage,
|
||||||
contact,
|
contact,
|
||||||
chatMessage.senderId ==
|
chatMessage.senderId ==
|
||||||
this.chatViewModel.settingsViewModel.settingsModel.userid
|
this.chatViewModel.settingsViewModel.settingsModel.userid,
|
||||||
);
|
);
|
||||||
|
|
||||||
const existingChatMessageViewModel: ChatMessageViewModel | undefined =
|
const existingChatMessageViewModel: ChatMessageViewModel | undefined =
|
||||||
|
|||||||
+6
-3
@@ -7,6 +7,7 @@ import StorageViewModel from "./ViewModel/Global/storageViewModel";
|
|||||||
import SettingsViewModel from "./ViewModel/Global/settingsViewModel";
|
import SettingsViewModel from "./ViewModel/Global/settingsViewModel";
|
||||||
import FileTransferViewModel from "./ViewModel/Global/fileTransferViewModel";
|
import FileTransferViewModel from "./ViewModel/Global/fileTransferViewModel";
|
||||||
import CoreViewModel from "./ViewModel/Global/coreViewModel";
|
import CoreViewModel from "./ViewModel/Global/coreViewModel";
|
||||||
|
import ContactListViewModel from "./ViewModel/Global/contactViewModel";
|
||||||
import ConnectionViewModel from "./ViewModel/Global/connectionViewModel";
|
import ConnectionViewModel from "./ViewModel/Global/connectionViewModel";
|
||||||
import ChatListViewModel from "./ViewModel/Chat/chatListViewModel";
|
import ChatListViewModel from "./ViewModel/Chat/chatListViewModel";
|
||||||
import { HomePage } from "./View/homePage";
|
import { HomePage } from "./View/homePage";
|
||||||
@@ -18,10 +19,9 @@ import { ConnectionModal } from "./View/Modals/connectionModal";
|
|||||||
import StorageModel from "./Model/Global/storageModel";
|
import StorageModel from "./Model/Global/storageModel";
|
||||||
import SettingsModel from "./Model/Global/settingsModel";
|
import SettingsModel from "./Model/Global/settingsModel";
|
||||||
import FileTransferModel from "./Model/Global/fileTransferModel";
|
import FileTransferModel from "./Model/Global/fileTransferModel";
|
||||||
|
import ContactListModel from "./Model/Global/contactListModel";
|
||||||
import ConnectionModel from "./Model/Global/connectionModel";
|
import ConnectionModel from "./Model/Global/connectionModel";
|
||||||
import ChatListModel from "./Model/Chat/chatListModel";
|
import ChatListModel from "./Model/Chat/chatListModel";
|
||||||
import ContactListModel from "./Model/Global/contactListModel";
|
|
||||||
import ContactListViewModel from "./ViewModel/Global/contactViewModel";
|
|
||||||
|
|
||||||
// models
|
// models
|
||||||
const storageModel = new StorageModel();
|
const storageModel = new StorageModel();
|
||||||
@@ -47,7 +47,10 @@ const coreViewModel = new CoreViewModel(
|
|||||||
|
|
||||||
const storageViewModel = new StorageViewModel(coreViewModel);
|
const storageViewModel = new StorageViewModel(coreViewModel);
|
||||||
const settingsViewModel = new SettingsViewModel(coreViewModel, settingsModel);
|
const settingsViewModel = new SettingsViewModel(coreViewModel, settingsModel);
|
||||||
const contactListViewModel = new ContactListViewModel(contactListModel, settingsViewModel);
|
const contactListViewModel = new ContactListViewModel(
|
||||||
|
contactListModel,
|
||||||
|
settingsViewModel,
|
||||||
|
);
|
||||||
const connectionViewModel = new ConnectionViewModel(coreViewModel);
|
const connectionViewModel = new ConnectionViewModel(coreViewModel);
|
||||||
const chatListViewModel = new ChatListViewModel(
|
const chatListViewModel = new ChatListViewModel(
|
||||||
coreViewModel,
|
coreViewModel,
|
||||||
|
|||||||
Reference in New Issue
Block a user