do not show namespaces in marquee

This commit is contained in:
marlon-erler
2026-09-23 00:39:51 +02:00
parent 9607a9f80c
commit f0087cf1cf
6 changed files with 45 additions and 37 deletions
+28 -31
View File
@@ -5596,6 +5596,19 @@
);
}
// src/View/Components/deletableListItem.tsx
function DeletableListItem(coreViewModel2, text, primaryButton, ondelete) {
return /* @__PURE__ */ createElement("div", { class: "tile flex-row justify-apart align-center padding-0" }, /* @__PURE__ */ createElement("span", { class: "padding-h ellipsis" }, text), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end" }, primaryButton, /* @__PURE__ */ createElement(
"button",
{
class: "danger",
"aria-label": coreViewModel2.translations.general.deleteItemButtonAudioLabel,
"on:click": ondelete
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "delete")
)));
}
// src/View/Modals/searchModal.tsx
function SearchModal(coreViewModel2, searchViewModel, headline, isOpen) {
function close() {
@@ -5670,24 +5683,21 @@
function applySuggestion() {
searchViewModel.search(suggestion);
}
return /* @__PURE__ */ createElement("div", { class: "flex-row surface align-center" }, /* @__PURE__ */ createElement("span", { class: "width-100 flex-1 padding-h" }, suggestion), /* @__PURE__ */ createElement(
"button",
{
class: "danger",
"aria-label": coreViewModel2.translations.general.deleteButton,
"on:click": deleteSuggestion
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "delete")
), /* @__PURE__ */ createElement(
"button",
{
class: "primary",
"aria-label": coreViewModel2.translations.general.applyButton,
"on:click": applySuggestion,
"toggle:disabled": isApplied
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "check")
));
return DeletableListItem(
coreViewModel2,
suggestion,
/* @__PURE__ */ createElement(
"button",
{
class: "primary",
"aria-label": coreViewModel2.translations.general.applyButton,
"on:click": applySuggestion,
"toggle:disabled": isApplied
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "check")
),
deleteSuggestion
);
}
// src/View/Components/colorPicker.tsx
@@ -5982,19 +5992,6 @@
);
}
// src/View/Components/deletableListItem.tsx
function DeletableListItem(coreViewModel2, text, primaryButton, ondelete) {
return /* @__PURE__ */ createElement("div", { class: "tile flex-row justify-apart align-center padding-0" }, /* @__PURE__ */ createElement("span", { class: "padding-h ellipsis" }, text), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end" }, primaryButton, /* @__PURE__ */ createElement(
"button",
{
class: "danger",
"aria-label": coreViewModel2.translations.general.deleteItemButtonAudioLabel,
"on:click": ondelete
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "delete")
)));
}
// src/View/ChatPages/settingsPage.tsx
function SettingsPage(coreViewModel2, settingsPageViewModel) {
settingsPageViewModel.loadData();
Binary file not shown.
Binary file not shown.
+10
View File
@@ -102,4 +102,14 @@ export default class ChatListViewModel {
this.loadChats();
}
// utility
stripNamespace = (fullChannel: string): string => {
for (const vm of this.chatViewModels.value) {
const fullReference = vm.chatModel.info.namespace + vm.chatModel.info.primaryChannel;
if (fullReference == fullChannel) return vm.chatModel.info.primaryChannel;
}
return fullChannel;
}
}
Binary file not shown.
@@ -13,12 +13,11 @@ export default class NotificationViewModel {
// main
showNotification = (message: ChatMessage): void => {
const notification: Notification =
NotificationViewModel.createNotification(message);
if (this.seenMessageIds.has(message.id)) return;
if (this.chatListViewModel.selectedChat.value == undefined) return;
const notification: Notification =
this.createNotification(message);
const currentChat =
this.chatListViewModel.selectedChat.value.chatModel
.unwrappedPrimaryChannel;
@@ -83,13 +82,15 @@ export default class NotificationViewModel {
};
// init
constructor(public readonly chatListViewModel: ChatListViewModel) {}
constructor(public chatListViewModel: ChatListViewModel) {}
// util
static createNotification(message: ChatMessage): Notification {
createNotification(message: ChatMessage): Notification {
const fullChannel = ChatModel.splitChannel(message.channel)[0];
const chat = this.chatListViewModel.stripNamespace(fullChannel);
return {
messageId: message.id,
chat: ChatModel.splitChannel(message.channel)[0],
chat,
sender: message.sender,
body: message.body,
};