Skip to content

Commit 7b7e16b

Browse files
authored
Merge pull request #125 from hideki0403/dev-kakurega
release: v2024.2.0-kakurega.1.29.3
2 parents ea54a1c + ad04e58 commit 7b7e16b

File tree

4 files changed

+42
-30
lines changed

4 files changed

+42
-30
lines changed

.github/workflows/docker.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Publish Docker image
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- '*'
67
workflow_dispatch:
78

89
env:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "misskey",
3-
"version": "2024.2.0-kakurega.1.29.2",
3+
"version": "2024.2.0-kakurega.1.29.3",
44
"codename": "nasubi",
55
"repository": {
66
"type": "git",

packages/frontend/src/components/MkNotification.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ SPDX-License-Identifier: AGPL-3.0-only
66
<template>
77
<div :class="$style.root">
88
<div :class="$style.head">
9-
<MkAvatar v-if="['pollEnded', 'note'].includes(notification.type) && notification.note" :class="$style.icon" :user="notification.note.user" link preview/>
9+
<MkAvatar v-if="['pollEnded', 'note'].includes(notification.type) && 'note' in notification" :class="$style.icon" :user="notification.note.user" link preview/>
1010
<MkAvatar v-else-if="['roleAssigned', 'achievementEarned'].includes(notification.type)" :class="$style.icon" :user="$i" link preview/>
1111
<div v-else-if="notification.type === 'reaction:grouped'" :class="[$style.icon, $style.icon_reactionGroup]"><i class="ti ti-plus" style="line-height: 1;"></i></div>
1212
<div v-else-if="notification.type === 'renote:grouped'" :class="[$style.icon, $style.icon_renoteGroup]"><i class="ti ti-repeat" style="line-height: 1;"></i></div>
1313
<img v-else-if="notification.type === 'test'" :class="$style.icon" :src="infoImageUrl"/>
14-
<MkAvatar v-else-if="notification.user" :class="$style.icon" :user="notification.user" link preview/>
15-
<img v-else-if="notification.icon" :class="[$style.icon, $style.icon_app]" :src="notification.icon" alt=""/>
14+
<MkAvatar v-else-if="'user' in notification" :class="$style.icon" :user="notification.user" link preview/>
15+
<img v-else-if="'icon' in notification" :class="[$style.icon, $style.icon_app]" :src="notification.icon" alt=""/>
1616
<div
1717
:class="[$style.subIcon, {
1818
[$style.t_follow]: notification.type === 'follow',
@@ -71,7 +71,7 @@ SPDX-License-Identifier: AGPL-3.0-only
7171
</MkA>
7272
<MkA v-else-if="notification.type === 'renote' || notification.type === 'renote:grouped'" :class="$style.text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note.renote)">
7373
<i class="ti ti-quote" :class="$style.quote"></i>
74-
<Mfm :text="getNoteSummary(notification.note.renote)" :plain="true" :nowrap="true" :author="notification.note.renote.user"/>
74+
<Mfm :text="getNoteSummary(notification.note.renote)" :plain="true" :nowrap="true" :author="notification.note.renote?.user"/>
7575
<i class="ti ti-quote" :class="$style.quote"></i>
7676
</MkA>
7777
<MkA v-else-if="notification.type === 'reply'" :class="$style.text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)">
@@ -163,13 +163,13 @@ const props = withDefaults(defineProps<{
163163
const followRequestDone = ref(false);
164164

165165
const acceptFollowRequest = () => {
166-
if (props.notification.user == null) return;
166+
if (!('user' in props.notification)) return;
167167
followRequestDone.value = true;
168168
misskeyApi('following/requests/accept', { userId: props.notification.user.id });
169169
};
170170

171171
const rejectFollowRequest = () => {
172-
if (props.notification.user == null) return;
172+
if (!('user' in props.notification)) return;
173173
followRequestDone.value = true;
174174
misskeyApi('following/requests/reject', { userId: props.notification.user.id });
175175
};

packages/frontend/src/ui/universal-zen.vue

+32-21
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<div>
88
<XAnnouncements v-if="$i" :class="$style.announcements"/>
99
<XStatusBars :class="$style.statusbars"/>
10-
<MkPageHeader v-if="isRootPage" :actions="headerActions"/>
10+
<MkPageHeader v-if="isRoot" :actions="headerActions"/>
1111
</div>
1212
</template>
13-
<MkSpacer v-if="isRootPage" :contentMax="800">
13+
<MkSpacer v-if="isRoot" :contentMax="800">
1414
<MkPostForm :class="$style.postForm" class="post-form _panel" fixed style="margin-bottom: var(--margin);"/>
1515
<XWidgets v-if="showWidgets"/>
1616
</MkSpacer>
@@ -23,9 +23,8 @@
2323
<i :class="$style.navButtonIcon" class="ti ti-menu-2"></i>
2424
<span v-if="menuIndicated" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span>
2525
</button>
26-
<button :class="$style.navButton" class="_button" @click="mainRouter.currentRoute.value.name === 'index' ? top() : mainRouter.push('/')">
27-
<i :class="$style.navButtonIcon" class="ti ti-home"></i>
28-
</button>
26+
<button :class="$style.navButton" class="_button" @click="isRoot ? top() : mainRouter.push('/')"><i :class="$style.navButtonIcon" class="ti ti-home"></i></button>
27+
<i :class="$style.navButtonIcon" class="ti ti-home"></i>
2928
<button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon" class="ti ti-pencil"></i></button>
3029
</div>
3130

@@ -66,7 +65,7 @@ import { navbarItemDef } from '@/navbar.js';
6665
import { i18n } from '@/i18n.js';
6766
import { $i } from '@/account.js';
6867
import { mainRouter } from '@/router/main.js';
69-
import { definePageMetadata, PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
68+
import { PageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
7069
import { deviceKind } from '@/scripts/device-kind.js';
7170
import { miLocalStorage } from '@/local-storage.js';
7271
import { CURRENT_STICKY_BOTTOM } from '@/const.js';
@@ -78,6 +77,8 @@ const XSidebar = defineAsyncComponent(() => import('@/ui/_common_/navbar.vue'));
7877
const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue'));
7978
const XAnnouncements = defineAsyncComponent(() => import('@/ui/_common_/announcements.vue'));
8079
80+
const isRoot = ref(mainRouter.currentRoute.value.name === 'index');
81+
8182
const DESKTOP_THRESHOLD = 1100;
8283
const MOBILE_THRESHOLD = 500;
8384
@@ -88,28 +89,43 @@ window.addEventListener('resize', () => {
8889
isMobile.value = deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD;
8990
});
9091
91-
const pageMetadata = ref<null | PageMetadata>();
92+
const defaultPageMetadata: PageMetadata = {
93+
title: i18n.ts.zenMode,
94+
icon: 'ti ti-seeding',
95+
};
96+
97+
const pageMetadata = ref<null | PageMetadata>(isRoot.value ? defaultPageMetadata : null);
9298
const navFooter = shallowRef<HTMLElement>();
9399
const contents = shallowRef<InstanceType<typeof MkStickyContainer>>();
94100
95-
const isRootPage = ref(mainRouter.currentRoute.value.path === '/');
96-
97101
const showWidgets = ref(zenStore.state.showWidgets);
98102
watch(zenStore.reactiveState.showWidgets, (value) => {
99103
showWidgets.value = value;
100104
});
101105
102-
watch(mainRouter.currentRoute, (route) => {
103-
isRootPage.value = route.path === '/';
106+
watch(mainRouter.currentRoute, () => {
107+
const isRootPage = mainRouter.currentRoute.value.name === 'index';
108+
isRoot.value = isRootPage;
109+
110+
if (isRootPage) {
111+
pageMetadata.value = defaultPageMetadata;
112+
}
104113
});
105114
106115
provide('router', mainRouter);
107-
provideMetadataReceiver((info) => {
108-
pageMetadata.value = info.value;
116+
provideMetadataReceiver((metadataGetter) => {
117+
const info = metadataGetter();
118+
pageMetadata.value = info;
119+
109120
if (pageMetadata.value) {
110-
document.title = `${pageMetadata.value.title} | ${instanceName}`;
121+
if (isRoot.value && pageMetadata.value.title === instanceName) {
122+
document.title = pageMetadata.value.title;
123+
} else {
124+
document.title = `${pageMetadata.value.title} | ${instanceName}`;
125+
}
111126
}
112127
});
128+
provideReactiveMetadata(pageMetadata);
113129
114130
const menuIndicated = computed(() => {
115131
for (const def in navbarItemDef) {
@@ -181,7 +197,7 @@ const onContextmenu = (ev) => {
181197
};
182198
183199
function top() {
184-
contents.value.rootEl.scrollTo({
200+
contents.value?.rootEl?.scrollTo({
185201
top: 0,
186202
behavior: 'smooth',
187203
});
@@ -204,7 +220,7 @@ watch(navFooter, () => {
204220
immediate: true,
205221
});
206222
207-
useScrollPositionManager(() => contents.value.rootEl, mainRouter);
223+
useScrollPositionManager(() => contents.value?.rootEl ?? null, mainRouter);
208224
209225
const headerActions = computed(() => [{
210226
icon: 'ti ti-settings',
@@ -213,11 +229,6 @@ const headerActions = computed(() => [{
213229
mainRouter.push('/settings/zen');
214230
},
215231
}]);
216-
217-
definePageMetadata(computed(() => ({
218-
title: i18n.ts.zenMode,
219-
icon: 'ti ti-seeding',
220-
})));
221232
</script>
222233

223234
<style>

0 commit comments

Comments
 (0)