make visible always on mobile

This commit is contained in:
nelle 2024-07-10 21:21:38 -06:00
parent 6068391e1d
commit 6b32eae520

View file

@ -93,7 +93,7 @@
</button>
<button
v-if="isMobile && mainRouter.currentRoute.value.name === 'index'"
v-if="isMobile"
ref="postButton"
:aria-label="i18n.t('note')"
class="postButton button post _button"
@ -101,17 +101,6 @@
>
<i class="ph-pencil ph-bold ph-lg"></i>
</button>
<button
v-if="
isMobile && mainRouter.currentRoute.value.name === 'messaging'
"
ref="postButton"
class="postButton button post _button"
:aria-label="i18n.t('startMessaging')"
@click="messagingStart"
>
<i class="ph-user-plus ph-bold ph-lg"></i>
</button>
</div>
<transition :name="$store.state.animation ? 'menuDrawer-back' : ''">
@ -217,11 +206,7 @@ function updateButtonState(): void {
buttonAnimIndex.value = 1;
return;
}
if (routerState.includes("/my/messaging")) {
buttonAnimIndex.value = 2;
return;
}
buttonAnimIndex.value = 3;
}
updateButtonState();
@ -277,34 +262,6 @@ function messagingStart(ev) {
);
}
async function startUser(): void {
os.selectUser().then((user) => {
mainRouter.push(`/my/messaging/${Acct.toString(user)}`);
});
}
async function startGroup(): void {
const groups1 = await os.api("users/groups/owned");
const groups2 = await os.api("users/groups/joined");
if (groups1.length === 0 && groups2.length === 0) {
os.alert({
type: "warning",
title: i18n.ts.youHaveNoGroups,
text: i18n.ts.joinOrCreateGroup,
});
return;
}
const { canceled, result: group } = await os.select({
title: i18n.ts.group,
items: groups1.concat(groups2).map((group) => ({
value: group,
text: group.name,
})),
});
if (canceled) return;
mainRouter.push(`/my/messaging/group/${group.id}`);
}
onMounted(() => {
if (!isDesktop.value) {
matchMedia(`(min-width: ${DESKTOP_THRESHOLD - 1}px)`).onchange = (