merge: Fix timeline top bar dropdowns to have consistent accurate behavior (!1252)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1252 Closes #1213 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Tess K <me@thvxl.se>
This commit is contained in:
commit
bfc319109e
3 changed files with 43 additions and 3 deletions
10
locales/index.d.ts
vendored
10
locales/index.d.ts
vendored
|
|
@ -13673,6 +13673,16 @@ export interface Locale extends ILocale {
|
|||
* Background queue
|
||||
*/
|
||||
"backgroundQueue": string;
|
||||
"_header": {
|
||||
/**
|
||||
* Browse
|
||||
*/
|
||||
"browse": string;
|
||||
/**
|
||||
* Manage
|
||||
*/
|
||||
"manage": string;
|
||||
};
|
||||
}
|
||||
declare const locales: {
|
||||
[lang: string]: Locale;
|
||||
|
|
|
|||
|
|
@ -140,14 +140,29 @@ async function chooseList(ev: MouseEvent): Promise<void> {
|
|||
(lists.length === 0 ? undefined : { type: 'divider' }),
|
||||
{
|
||||
type: 'link' as const,
|
||||
icon: 'ti ti-pencil',
|
||||
text: i18n.ts._header.manage,
|
||||
to: '/my/lists',
|
||||
},
|
||||
{
|
||||
icon: 'ti ti-plus',
|
||||
text: i18n.ts.createNew,
|
||||
to: '/my/lists',
|
||||
action: createList,
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
async function createList() {
|
||||
const { canceled, result: name } = await os.inputText({
|
||||
title: i18n.ts.enterListName,
|
||||
});
|
||||
if (canceled || name === null) return;
|
||||
const list = await os.apiWithDialog('users/lists/create', { name: name });
|
||||
userListsCache.delete();
|
||||
router.push(`/my/lists/${list.id}`);
|
||||
}
|
||||
|
||||
async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
||||
const antennas = await antennasCache.fetch();
|
||||
const items: MenuItem[] = [
|
||||
|
|
@ -158,11 +173,17 @@ async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
|||
to: `/timeline/antenna/${antenna.id}`,
|
||||
})),
|
||||
(antennas.length === 0 ? undefined : { type: 'divider' }),
|
||||
{
|
||||
type: 'link' as const,
|
||||
icon: 'ti ti-pencil',
|
||||
text: i18n.ts._header.manage,
|
||||
to: '/my/antennas',
|
||||
},
|
||||
{
|
||||
type: 'link' as const,
|
||||
icon: 'ti ti-plus',
|
||||
text: i18n.ts.createNew,
|
||||
to: '/my/antennas',
|
||||
to: '/my/antennas/create',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
|
|
@ -183,11 +204,17 @@ async function chooseChannel(ev: MouseEvent): Promise<void> {
|
|||
};
|
||||
}),
|
||||
(channels.length === 0 ? undefined : { type: 'divider' }),
|
||||
{
|
||||
type: 'link',
|
||||
icon: 'ti ti-search',
|
||||
text: i18n.ts._header.browse,
|
||||
to: '/channels',
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
icon: 'ti ti-plus',
|
||||
text: i18n.ts.createNew,
|
||||
to: '/channels',
|
||||
to: '/channels/new',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
|
|
|
|||
|
|
@ -733,3 +733,6 @@ restartMigrationDescription: "Account migration was last attempted {date}. If th
|
|||
restartMigrationConfirm: "Are you sure you want to restart this account migration?"
|
||||
|
||||
backgroundQueue: "Background queue"
|
||||
_header:
|
||||
browse: "Browse"
|
||||
manage: "Manage"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue