summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-08-26 09:08:00 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-08-26 09:08:00 +0900
commit9e5c8d94bff0352bca3b15fd75a7c6ccaa1df2ff (patch)
treee6e86b8b5297d615890ce2f35692d95c78e3fd9e /packages/frontend/src
parentrefactoe (diff)
downloadmisskey-9e5c8d94bff0352bca3b15fd75a7c6ccaa1df2ff.tar.gz
misskey-9e5c8d94bff0352bca3b15fd75a7c6ccaa1df2ff.tar.bz2
misskey-9e5c8d94bff0352bca3b15fd75a7c6ccaa1df2ff.zip
refactor
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkAchievements.vue6
-rw-r--r--packages/frontend/src/components/MkAnimBg.vue2
-rw-r--r--packages/frontend/src/pages/admin-file.vue4
-rw-r--r--packages/frontend/src/pages/announcement.vue6
-rw-r--r--packages/frontend/src/pages/drive.file.info.vue12
-rw-r--r--packages/frontend/src/pages/install-extensions.vue4
-rw-r--r--packages/frontend/src/pages/instance-info.vue4
-rw-r--r--packages/frontend/src/pages/my-antennas/index.vue6
-rw-r--r--packages/frontend/src/pages/my-lists/index.vue10
-rw-r--r--packages/frontend/src/pages/settings/index.vue6
-rw-r--r--packages/frontend/src/pages/settings/profile.vue2
-rw-r--r--packages/frontend/src/pages/settings/theme.install.vue6
-rw-r--r--packages/frontend/src/pages/settings/theme.manage.vue2
-rw-r--r--packages/frontend/src/theme.ts1
14 files changed, 39 insertions, 32 deletions
diff --git a/packages/frontend/src/components/MkAchievements.vue b/packages/frontend/src/components/MkAchievements.vue
index 70766634ce..3b7b59b4d3 100644
--- a/packages/frontend/src/components/MkAchievements.vue
+++ b/packages/frontend/src/components/MkAchievements.vue
@@ -71,7 +71,7 @@ const props = withDefaults(defineProps<{
const achievements = ref<Misskey.entities.UsersAchievementsResponse | null>(null);
const lockedAchievements = computed(() => ACHIEVEMENT_TYPES.filter(x => !(achievements.value ?? []).some(a => a.name === x)));
-function fetch() {
+function _fetch_() {
misskeyApi('users/achievements', { userId: props.user.id }).then(res => {
achievements.value = [];
for (const t of ACHIEVEMENT_TYPES) {
@@ -84,11 +84,11 @@ function fetch() {
function clickHere() {
claimAchievement('clickedClickHere');
- fetch();
+ _fetch_();
}
onMounted(() => {
- fetch();
+ _fetch_();
});
</script>
diff --git a/packages/frontend/src/components/MkAnimBg.vue b/packages/frontend/src/components/MkAnimBg.vue
index 82606c9aa4..19a21f6e24 100644
--- a/packages/frontend/src/components/MkAnimBg.vue
+++ b/packages/frontend/src/components/MkAnimBg.vue
@@ -265,6 +265,8 @@ onUnmounted(() => {
if (handle) {
window.cancelAnimationFrame(handle);
}
+
+ // TODO: WebGLリソースの解放
});
</script>
diff --git a/packages/frontend/src/pages/admin-file.vue b/packages/frontend/src/pages/admin-file.vue
index 7a49ba542f..90b3ca81cf 100644
--- a/packages/frontend/src/pages/admin-file.vue
+++ b/packages/frontend/src/pages/admin-file.vue
@@ -111,13 +111,13 @@ const props = defineProps<{
fileId: string,
}>();
-async function fetch() {
+async function _fetch_() {
file.value = await misskeyApi('drive/files/show', { fileId: props.fileId });
info.value = await misskeyApi('admin/drive/show-file', { fileId: props.fileId });
isSensitive.value = file.value.isSensitive;
}
-fetch();
+_fetch_();
async function del() {
const { canceled } = await os.confirm({
diff --git a/packages/frontend/src/pages/announcement.vue b/packages/frontend/src/pages/announcement.vue
index f9b870eda1..0bcfd28f67 100644
--- a/packages/frontend/src/pages/announcement.vue
+++ b/packages/frontend/src/pages/announcement.vue
@@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton primary @click="read(announcement)"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
</div>
</div>
- <MkError v-else-if="error" @retry="fetch()"/>
+ <MkError v-else-if="error" @retry="_fetch_()"/>
<MkLoading v-else/>
</Transition>
</div>
@@ -66,7 +66,7 @@ const announcement = ref<Misskey.entities.Announcement | null>(null);
const error = ref<any>(null);
const path = computed(() => props.announcementId);
-function fetch() {
+function _fetch_() {
announcement.value = null;
misskeyApi('announcements/show', {
announcementId: props.announcementId,
@@ -96,7 +96,7 @@ async function read(target: Misskey.entities.Announcement): Promise<void> {
}
}
-watch(() => path.value, fetch, { immediate: true });
+watch(() => path.value, _fetch_, { immediate: true });
const headerActions = computed(() => []);
diff --git a/packages/frontend/src/pages/drive.file.info.vue b/packages/frontend/src/pages/drive.file.info.vue
index 1def215afc..79c249413a 100644
--- a/packages/frontend/src/pages/drive.file.info.vue
+++ b/packages/frontend/src/pages/drive.file.info.vue
@@ -105,7 +105,7 @@ const folderHierarchy = computed(() => {
});
const isImage = computed(() => file.value?.type.startsWith('image/'));
-async function fetch() {
+async function _fetch_() {
fetching.value = true;
file.value = await misskeyApi('drive/files/show', {
@@ -134,7 +134,7 @@ function move() {
fileId: file.value.id,
folderId: folder[0] ? folder[0].id : null,
}).then(async () => {
- await fetch();
+ await _fetch_();
});
});
}
@@ -146,7 +146,7 @@ function toggleSensitive() {
fileId: file.value.id,
isSensitive: !file.value.isSensitive,
}).then(async () => {
- await fetch();
+ await _fetch_();
}).catch(err => {
os.alert({
type: 'error',
@@ -169,7 +169,7 @@ function rename() {
fileId: file.value.id,
name: name,
}).then(async () => {
- await fetch();
+ await _fetch_();
});
});
}
@@ -186,7 +186,7 @@ async function describe() {
fileId: file.value.id,
comment: caption.length === 0 ? null : caption,
}).then(async () => {
- await fetch();
+ await _fetch_();
});
},
closed: () => dispose(),
@@ -212,7 +212,7 @@ async function deleteFile() {
}
onMounted(async () => {
- await fetch();
+ await _fetch_();
});
</script>
diff --git a/packages/frontend/src/pages/install-extensions.vue b/packages/frontend/src/pages/install-extensions.vue
index 1b3c6616cc..4b87e0da6b 100644
--- a/packages/frontend/src/pages/install-extensions.vue
+++ b/packages/frontend/src/pages/install-extensions.vue
@@ -80,7 +80,7 @@ function close_(): void {
}
}
-async function fetch() {
+async function _fetch_() {
if (!url.value || !hash.value) {
errorKV.value = {
title: i18n.ts._externalResourceInstaller._errors._invalidParams.title,
@@ -229,7 +229,7 @@ async function install() {
const urlParams = new URLSearchParams(window.location.search);
url.value = urlParams.get('url');
hash.value = urlParams.get('hash');
-fetch();
+_fetch_();
definePage(() => ({
title: i18n.ts._externalResourceInstaller.title,
diff --git a/packages/frontend/src/pages/instance-info.vue b/packages/frontend/src/pages/instance-info.vue
index 4be5fa447d..473207fe6e 100644
--- a/packages/frontend/src/pages/instance-info.vue
+++ b/packages/frontend/src/pages/instance-info.vue
@@ -198,7 +198,7 @@ if (iAmModerator) {
});
}
-async function fetch(): Promise<void> {
+async function _fetch_(): Promise<void> {
if (iAmAdmin) {
meta.value = await misskeyApi('admin/meta');
}
@@ -276,7 +276,7 @@ function refreshMetadata(): void {
});
}
-fetch();
+_fetch_();
const headerActions = computed(() => [{
text: `https://${props.host}`,
diff --git a/packages/frontend/src/pages/my-antennas/index.vue b/packages/frontend/src/pages/my-antennas/index.vue
index 95a3108e3a..d7625a8a1c 100644
--- a/packages/frontend/src/pages/my-antennas/index.vue
+++ b/packages/frontend/src/pages/my-antennas/index.vue
@@ -30,11 +30,11 @@ import { antennasCache } from '@/cache.js';
const antennas = computed(() => antennasCache.value.value ?? []);
-function fetch() {
+function _fetch_() {
antennasCache.fetch();
}
-fetch();
+_fetch_();
const headerActions = computed(() => [{
asFullButton: true,
@@ -42,7 +42,7 @@ const headerActions = computed(() => [{
text: i18n.ts.reload,
handler: () => {
antennasCache.delete();
- fetch();
+ _fetch_();
},
}]);
diff --git a/packages/frontend/src/pages/my-lists/index.vue b/packages/frontend/src/pages/my-lists/index.vue
index 0933618f54..43d5432f66 100644
--- a/packages/frontend/src/pages/my-lists/index.vue
+++ b/packages/frontend/src/pages/my-lists/index.vue
@@ -40,11 +40,11 @@ const $i = ensureSignin();
const items = computed(() => userListsCache.value.value ?? []);
-function fetch() {
+function _fetch_() {
userListsCache.fetch();
}
-fetch();
+_fetch_();
async function create() {
const { canceled, result: name } = await os.inputText({
@@ -53,7 +53,7 @@ async function create() {
if (canceled || name == null) return;
await os.apiWithDialog('users/lists/create', { name: name });
userListsCache.delete();
- fetch();
+ _fetch_();
}
const headerActions = computed(() => [{
@@ -62,7 +62,7 @@ const headerActions = computed(() => [{
text: i18n.ts.reload,
handler: () => {
userListsCache.delete();
- fetch();
+ _fetch_();
},
}]);
@@ -74,7 +74,7 @@ definePage(() => ({
}));
onActivated(() => {
- fetch();
+ _fetch_();
});
</script>
diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue
index eda9dfde7b..250c1735be 100644
--- a/packages/frontend/src/pages/settings/index.vue
+++ b/packages/frontend/src/pages/settings/index.vue
@@ -188,6 +188,8 @@ const menuDef = computed<SuperMenuDef[]>(() => [{
}]);
onMounted(() => {
+ if (el.value == null) return; // TSを黙らすため
+
ro.observe(el.value);
narrow.value = el.value.offsetWidth < NARROW_THRESHOLD;
@@ -198,6 +200,8 @@ onMounted(() => {
});
onActivated(() => {
+ if (el.value == null) return; // TSを黙らすため
+
narrow.value = el.value.offsetWidth < NARROW_THRESHOLD;
if (!narrow.value && currentPage.value?.route.name == null) {
@@ -215,7 +219,7 @@ watch(router.currentRef, (to) => {
}
});
-const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified));
+const emailNotConfigured = computed(() => $i && instance.enableEmail && ($i.email == null || !$i.emailVerified));
provideMetadataReceiver((metadataGetter) => {
const info = metadataGetter();
diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue
index e2679623ef..4816a6e33b 100644
--- a/packages/frontend/src/pages/settings/profile.vue
+++ b/packages/frontend/src/pages/settings/profile.vue
@@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<SearchMarker path="/settings/profile" :label="i18n.ts.profile" :keywords="['profile']" icon="ti ti-user">
<div class="_gaps_m">
<div class="_panel">
- <div :class="$style.banner" :style="{ backgroundImage: $i.bannerUrl ? `url(${ $i.bannerUrl })` : null }">
+ <div :class="$style.banner" :style="{ backgroundImage: $i.bannerUrl ? `url(${ $i.bannerUrl })` : '' }">
<div :class="$style.bannerEdit">
<SearchMarker :keywords="['banner', 'change']">
<MkButton primary rounded @click="changeBanner"><SearchLabel>{{ i18n.ts._profile.changeBanner }}</SearchLabel></MkButton>
diff --git a/packages/frontend/src/pages/settings/theme.install.vue b/packages/frontend/src/pages/settings/theme.install.vue
index ac95279402..f79357c361 100644
--- a/packages/frontend/src/pages/settings/theme.install.vue
+++ b/packages/frontend/src/pages/settings/theme.install.vue
@@ -10,8 +10,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkCodeEditor>
<div class="_buttons">
- <MkButton :disabled="installThemeCode == null || installThemeCode.trim() === ''" inline @click="() => previewTheme(installThemeCode)"><i class="ti ti-eye"></i> {{ i18n.ts.preview }}</MkButton>
- <MkButton :disabled="installThemeCode == null || installThemeCode.trim() === ''" primary inline @click="() => install(installThemeCode)"><i class="ti ti-check"></i> {{ i18n.ts.install }}</MkButton>
+ <MkButton :disabled="installThemeCode == null || installThemeCode.trim() === ''" inline @click="() => previewTheme(installThemeCode!)"><i class="ti ti-eye"></i> {{ i18n.ts.preview }}</MkButton>
+ <MkButton :disabled="installThemeCode == null || installThemeCode.trim() === ''" primary inline @click="() => install(installThemeCode!)"><i class="ti ti-check"></i> {{ i18n.ts.install }}</MkButton>
</div>
</div>
</template>
@@ -39,7 +39,7 @@ async function install(code: string): Promise<void> {
});
installThemeCode.value = null;
router.push('/settings/theme');
- } catch (err) {
+ } catch (err: any) {
switch (err.message.toLowerCase()) {
case 'this theme is already installed':
os.alert({
diff --git a/packages/frontend/src/pages/settings/theme.manage.vue b/packages/frontend/src/pages/settings/theme.manage.vue
index fcd0b293e0..e972184278 100644
--- a/packages/frontend/src/pages/settings/theme.manage.vue
+++ b/packages/frontend/src/pages/settings/theme.manage.vue
@@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts._theme.code }}</template>
<template #caption><button class="_textButton" @click="copyThemeCode()">{{ i18n.ts.copy }}</button></template>
</MkTextarea>
- <MkButton v-if="!builtinThemes.some(t => t.id == selectedTheme.id)" danger @click="uninstall()"><i class="ti ti-trash"></i> {{ i18n.ts.uninstall }}</MkButton>
+ <MkButton v-if="!builtinThemes.some(t => t.id == selectedTheme!.id)" danger @click="uninstall()"><i class="ti ti-trash"></i> {{ i18n.ts.uninstall }}</MkButton>
</template>
</div>
</template>
diff --git a/packages/frontend/src/theme.ts b/packages/frontend/src/theme.ts
index 036b86cff8..b715426917 100644
--- a/packages/frontend/src/theme.ts
+++ b/packages/frontend/src/theme.ts
@@ -23,6 +23,7 @@ export type Theme = {
author: string;
desc?: string;
base?: 'dark' | 'light';
+ kind?: 'dark' | 'light'; // legacy
props: Record<string, string>;
codeHighlighter?: {
base: BundledTheme;