plus action on top right for dms

This commit is contained in:
ThatOneCalculator 2022-11-14 16:24:04 -08:00
parent 39f2a9fb12
commit 6dac040325
2 changed files with 20 additions and 2 deletions

View file

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

View file

@ -64,7 +64,12 @@ const tabs = ['dms', 'groups'];
let tab = $ref(tabs[0]); let tab = $ref(tabs[0]);
watch($$(tab), () => (syncSlide(tabs.indexOf(tab)))); 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(() => [{ const headerTabs = $computed(() => [{
key: 'dms', 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 { async function startUser(): void {
os.selectUser().then(user => { os.selectUser().then(user => {
router.push(`/my/messaging/${Acct.toString(user)}`); router.push(`/my/messaging/${Acct.toString(user)}`);