refactor
This commit is contained in:
parent
692284886b
commit
1c966db324
|
|
@ -37,27 +37,14 @@ const props = defineProps<{
|
||||||
const antenna = ref<Misskey.entities.Antenna | null>(null);
|
const antenna = ref<Misskey.entities.Antenna | null>(null);
|
||||||
const tlEl = useTemplateRef('tlEl');
|
const tlEl = useTemplateRef('tlEl');
|
||||||
|
|
||||||
async function timetravel() {
|
|
||||||
const { canceled, result: date } = await os.inputDate({
|
|
||||||
title: i18n.ts.date,
|
|
||||||
});
|
|
||||||
if (canceled) return;
|
|
||||||
|
|
||||||
tlEl.value.timetravel(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
function settings() {
|
function settings() {
|
||||||
router.push('/my/antennas/:antennaId', {
|
router.push('/my/antennas/:antennaId', {
|
||||||
params: {
|
params: {
|
||||||
antennaId: props.antennaId,
|
antennaId: props.antennaId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function focus() {
|
|
||||||
tlEl.value.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(() => props.antennaId, async () => {
|
watch(() => props.antennaId, async () => {
|
||||||
antenna.value = await misskeyApi('antennas/show', {
|
antenna.value = await misskeyApi('antennas/show', {
|
||||||
antennaId: props.antennaId,
|
antennaId: props.antennaId,
|
||||||
|
|
@ -65,10 +52,6 @@ watch(() => props.antennaId, async () => {
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
const headerActions = computed(() => antenna.value ? [{
|
const headerActions = computed(() => antenna.value ? [{
|
||||||
icon: 'ti ti-calendar-time',
|
|
||||||
text: i18n.ts.jumpToSpecifiedDate,
|
|
||||||
handler: timetravel,
|
|
||||||
}, {
|
|
||||||
icon: 'ti ti-settings',
|
icon: 'ti ti-settings',
|
||||||
text: i18n.ts.settings,
|
text: i18n.ts.settings,
|
||||||
handler: settings,
|
handler: settings,
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,13 @@ const name = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function cancel() {
|
function cancel() {
|
||||||
misskeyApi('auth/deny', {
|
//misskeyApi('auth/deny', {
|
||||||
token: props.session.token,
|
// token: props.session.token,
|
||||||
}).then(() => {
|
//}).then(() => {
|
||||||
emit('denied');
|
// emit('denied');
|
||||||
});
|
//});
|
||||||
|
|
||||||
|
emit('denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
function accept() {
|
function accept() {
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,8 @@ watch(() => props.channelId, async () => {
|
||||||
channel.value = await misskeyApi('channels/show', {
|
channel.value = await misskeyApi('channels/show', {
|
||||||
channelId: props.channelId,
|
channelId: props.channelId,
|
||||||
});
|
});
|
||||||
|
if (channel.value == null) return; // TSを黙らすため
|
||||||
|
|
||||||
favorited.value = channel.value.isFavorited ?? false;
|
favorited.value = channel.value.isFavorited ?? false;
|
||||||
if (favorited.value || channel.value.isFollowing) {
|
if (favorited.value || channel.value.isFollowing) {
|
||||||
tab.value = 'timeline';
|
tab.value = 'timeline';
|
||||||
|
|
@ -150,7 +152,7 @@ function edit() {
|
||||||
router.push('/channels/:channelId/edit', {
|
router.push('/channels/:channelId/edit', {
|
||||||
params: {
|
params: {
|
||||||
channelId: props.channelId,
|
channelId: props.channelId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue