Fix chat actions labels (#6474)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-09-03 22:14:17 +04:00 committed by GitHub
parent 4b07b31126
commit a16b0a64d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 12 deletions

View File

@ -169,7 +169,7 @@ export function defineActions (builder: Builder): void {
icon: view.icon.EyeCrossed,
label: view.string.Hide,
query: {
attachedToClass: { $nin: [chunter.class.DirectMessage, chunter.class.Channel] }
objectClass: { $nin: [chunter.class.DirectMessage, chunter.class.Channel] }
}
},
chunter.action.RemoveChannel
@ -181,7 +181,7 @@ export function defineActions (builder: Builder): void {
...actionTemplates.removeChannel,
label: chunter.string.CloseConversation,
query: {
attachedToClass: chunter.class.DirectMessage
objectClass: chunter.class.DirectMessage
}
},
chunter.action.CloseConversation
@ -194,7 +194,7 @@ export function defineActions (builder: Builder): void {
action: chunter.actionImpl.LeaveChannel,
label: chunter.string.LeaveChannel,
query: {
attachedToClass: chunter.class.Channel
objectClass: chunter.class.Channel
}
},
chunter.action.LeaveChannel
@ -204,7 +204,7 @@ export function defineActions (builder: Builder): void {
...notificationActionTemplates.pinContext,
label: chunter.string.StarChannel,
query: {
attachedToClass: chunter.class.Channel
objectClass: chunter.class.Channel
},
override: [notification.action.PinDocNotifyContext]
})
@ -213,7 +213,7 @@ export function defineActions (builder: Builder): void {
...notificationActionTemplates.unpinContext,
label: chunter.string.UnstarChannel,
query: {
attachedToClass: chunter.class.Channel
objectClass: chunter.class.Channel
}
})
@ -221,7 +221,7 @@ export function defineActions (builder: Builder): void {
...notificationActionTemplates.pinContext,
label: chunter.string.StarConversation,
query: {
attachedToClass: chunter.class.DirectMessage
objectClass: chunter.class.DirectMessage
}
})
@ -229,21 +229,21 @@ export function defineActions (builder: Builder): void {
...notificationActionTemplates.unpinContext,
label: chunter.string.UnstarConversation,
query: {
attachedToClass: chunter.class.DirectMessage
objectClass: chunter.class.DirectMessage
}
})
createAction(builder, {
...notificationActionTemplates.pinContext,
query: {
attachedToClass: { $nin: [chunter.class.DirectMessage, chunter.class.Channel] }
objectClass: { $nin: [chunter.class.DirectMessage, chunter.class.Channel] }
}
})
createAction(builder, {
...notificationActionTemplates.unpinContext,
query: {
attachedToClass: { $nin: [chunter.class.DirectMessage, chunter.class.Channel] }
objectClass: { $nin: [chunter.class.DirectMessage, chunter.class.Channel] }
}
})
}

View File

@ -16,7 +16,7 @@
justify={'left'}
size={'x-large'}
on:click={(evt) => {
ArchiveChannel(channel, evt, () => dispatch('close'))
ArchiveChannel(channel, evt, { afterArchive: () => dispatch('close') })
}}
/>
{/if}

View File

@ -79,7 +79,7 @@ export { default as ChatMessagesPresenter } from './components/chat-message/Chat
export { default as Header } from './components/Header.svelte'
export { default as ThreadView } from './components/threads/ThreadView.svelte'
export async function ArchiveChannel (channel: Channel, evt: any, afterArchive?: () => void): Promise<void> {
export async function ArchiveChannel (channel: Channel, evt: any, props?: { afterArchive?: () => void }): Promise<void> {
showPopup(MessageBox, {
label: chunter.string.ArchiveChannel,
message: chunter.string.ArchiveConfirm,
@ -88,7 +88,7 @@ export async function ArchiveChannel (channel: Channel, evt: any, afterArchive?:
// eslint-disable-next-line @typescript-eslint/no-floating-promises
await client.update(channel, { archived: true })
if (afterArchive != null) afterArchive()
if (props?.afterArchive != null) props.afterArchive()
const loc = getLocation()
if (loc.path[3] === channel._id) {