plus action on top right for dms

This commit is contained in:
ThatOneCalculator 2022-11-14 16:24:04 -08:00
parent bc006b8c97
commit 144c9e7405
2 changed files with 20 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "12.119.0-calc.13-rc.1",
"version": "12.119.0-calc.13-rc.2",
"codename": "aqua",
"repository": {
"type": "git",

View File

@ -64,7 +64,12 @@ const tabs = ['dms', 'groups'];
let tab = $ref(tabs[0]);
watch($$(tab), () => (syncSlide(tabs.indexOf(tab))));
const headerActions = $computed(() => []);
const headerActions = $computed(() => [{
asFullButton: true,
icon: 'ph-plus-bold ph-lg',
text: i18n.ts.addUser,
handler: startMenu,
}]);
const headerTabs = $computed(() => [{
key: 'dms',
@ -122,6 +127,19 @@ function onRead(ids): void {
}
}
function startMenu(ev) {
os.popupMenu([{
text: i18n.ts.messagingWithUser,
icon: 'fas fa-user',
action: () => { startUser(); },
}, {
text: i18n.ts.messagingWithGroup,
icon: 'fas fa-users',
action: () => { startGroup(); },
}], ev.currentTarget ?? ev.target);
}
async function startUser(): void {
os.selectUser().then(user => {
router.push(`/my/messaging/${Acct.toString(user)}`);