merge upstream for 2024.2.1

This commit is contained in:
dakkar 2024-03-02 16:36:49 +00:00 committed by Amelia Yukii
parent eab7d5bd27
commit af548d05ca
137 changed files with 4524 additions and 2933 deletions

View file

@ -117,6 +117,7 @@ import XMentionsColumn from '@/ui/deck/mentions-column.vue';
import XDirectColumn from '@/ui/deck/direct-column.vue';
import XRoleTimelineColumn from '@/ui/deck/role-timeline-column.vue';
import { mainRouter } from '@/router/main.js';
import { MenuItem } from '@/types/menu.js';
const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue'));
const XAnnouncements = defineAsyncComponent(() => import('@/ui/_common_/announcements.vue'));
@ -221,21 +222,19 @@ document.documentElement.style.scrollBehavior = 'auto';
loadDeck();
function changeProfile(ev: MouseEvent) {
const items = ref([{
let items: MenuItem[] = [{
text: deckStore.state.profile,
active: true.valueOf,
}]);
active: true,
action: () => {},
}];
getProfiles().then(profiles => {
items.value = [{
text: deckStore.state.profile,
active: true.valueOf,
}, ...(profiles.filter(k => k !== deckStore.state.profile).map(k => ({
items.push(...(profiles.filter(k => k !== deckStore.state.profile).map(k => ({
text: k,
action: () => {
deckStore.set('profile', k);
unisonReload();
},
}))), { type: 'divider' }, {
}))), { type: 'divider' as const }, {
text: i18n.ts._deck.newProfile,
icon: 'ph-plus ph-bold ph-lg',
action: async () => {
@ -248,9 +247,10 @@ function changeProfile(ev: MouseEvent) {
deckStore.set('profile', name);
unisonReload();
},
}];
});
}).then(() => {
os.popupMenu(items, ev.currentTarget ?? ev.target);
});
os.popupMenu(items, ev.currentTarget ?? ev.target);
}
async function deleteProfile() {