fix type errors
This commit is contained in:
parent
d979cd2c07
commit
b4a0fdfaa1
|
@ -107,7 +107,7 @@ const withSensitive = computed<boolean>({
|
|||
|
||||
async function chooseList(ev: MouseEvent): Promise<void> {
|
||||
const lists = await userListsCache.fetch();
|
||||
const items: MenuItem[] = [
|
||||
const items: (MenuItem | undefined)[] = [
|
||||
...lists.map(list => ({
|
||||
type: 'link' as const,
|
||||
text: list.name,
|
||||
|
@ -121,12 +121,12 @@ async function chooseList(ev: MouseEvent): Promise<void> {
|
|||
to: '/my/lists',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
os.popupMenu(items.filter(i => i != null), ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
||||
const antennas = await antennasCache.fetch();
|
||||
const items: MenuItem[] = [
|
||||
const items: (MenuItem | undefined)[] = [
|
||||
...antennas.map(antenna => ({
|
||||
type: 'link' as const,
|
||||
text: antenna.name,
|
||||
|
@ -141,12 +141,12 @@ async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
|||
to: '/my/antennas',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
os.popupMenu(items.filter(i => i != null), ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
async function chooseChannel(ev: MouseEvent): Promise<void> {
|
||||
const channels = await favoritedChannelsCache.fetch();
|
||||
const items: MenuItem[] = [
|
||||
const items: (MenuItem | undefined)[] = [
|
||||
...channels.map(channel => {
|
||||
const lastReadedAt = miLocalStorage.getItemAsJson(`channelLastReadedAt:${channel.id}`) ?? null;
|
||||
const hasUnreadNote = (lastReadedAt && channel.lastNotedAt) ? Date.parse(channel.lastNotedAt) > lastReadedAt : !!(!lastReadedAt && channel.lastNotedAt);
|
||||
|
@ -166,7 +166,7 @@ async function chooseChannel(ev: MouseEvent): Promise<void> {
|
|||
to: '/channels',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
os.popupMenu(items.filter(i => i != null), ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
function saveSrc(newSrc: TimelinePageSrc): void {
|
||||
|
@ -190,19 +190,6 @@ function saveTlFilter(key: keyof typeof store.s.tl.filter, newValue: boolean) {
|
|||
}
|
||||
}
|
||||
|
||||
async function timetravel(): Promise<void> {
|
||||
const { canceled, result: date } = await os.inputDate({
|
||||
title: i18n.ts.date,
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
tlComponent.value.timetravel(date);
|
||||
}
|
||||
|
||||
function focus(): void {
|
||||
tlComponent.value.focus();
|
||||
}
|
||||
|
||||
function switchTlIfNeeded() {
|
||||
if (isBasicTimeline(src.value) && !isAvailableBasicTimeline(src.value)) {
|
||||
src.value = availableBasicTimelines()[0];
|
||||
|
|
Loading…
Reference in New Issue