semaphore/src/routes/_actions/toggleMute.js

11 lines
367 B
JavaScript

import { importShowMuteDialog } from '../_components/dialog/asyncDialogs/importShowMuteDialog.js'
import { setAccountMuted } from './mute.js'
export async function toggleMute (account, mute) {
if (mute) {
(await importShowMuteDialog())(account)
} else {
await setAccountMuted(account.id, mute, /* notifications */ false, /* toastOnSuccess */ true)
}
}