Compare commits
37 Commits
c57e49516c
...
67c4b7895e
| Author | SHA1 | Date |
|---|---|---|
|
|
67c4b7895e | |
|
|
de956d8dee | |
|
|
79d12d1ceb | |
|
|
4ff9390194 | |
|
|
0e267f25a7 | |
|
|
ccecf3cdd0 | |
|
|
dc8a130570 | |
|
|
41ba242c9c | |
|
|
e6f3dd81ba | |
|
|
ec229dbd3b | |
|
|
f6a3f6f5f1 | |
|
|
b26e4dc505 | |
|
|
43375409f7 | |
|
|
fb924e6dc3 | |
|
|
89c245c5e4 | |
|
|
fe04bc6fb1 | |
|
|
58894838f0 | |
|
|
5a3d7f9ef8 | |
|
|
68a2d9675f | |
|
|
9165dc4493 | |
|
|
6eaadfac7b | |
|
|
1294f5f06f | |
|
|
c73ec73920 | |
|
|
8a3dbc1c99 | |
|
|
d25c38911d | |
|
|
f7511ac93c | |
|
|
ba6399fac6 | |
|
|
da3ca548fe | |
|
|
01ff597e65 | |
|
|
615e25f4fa | |
|
|
225eabb19d | |
|
|
718021f15c | |
|
|
485f89d262 | |
|
|
93e8317da1 | |
|
|
39d686ad11 | |
|
|
d60aa72c63 | |
|
|
ed36a08bad |
|
|
@ -6,7 +6,7 @@
|
|||
"features": {
|
||||
"ghcr.io/devcontainers-contrib/features/pnpm:2": {},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "20.3.1"
|
||||
"version": "20.5.0"
|
||||
}
|
||||
},
|
||||
"forwardPorts": [3000],
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
20.3.1
|
||||
20.5.0
|
||||
|
|
|
|||
|
|
@ -25,9 +25,13 @@
|
|||
- Enhance: 自分が押したリアクションのデザインを改善
|
||||
- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正
|
||||
- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正
|
||||
- Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正
|
||||
|
||||
### Server
|
||||
- cacheRemoteFilesの初期値はfalseになりました
|
||||
- 一部のfeatured noteを照会できない問題を修正
|
||||
- ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善
|
||||
- fix: muteがapiからのuser list timeline取得で機能しない問題を修正
|
||||
|
||||
## 13.14.2
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax = docker/dockerfile:1.4
|
||||
|
||||
ARG NODE_VERSION=20.3.1-bullseye
|
||||
ARG NODE_VERSION=20.5.0-bullseye
|
||||
|
||||
# build assets & compile TypeScript
|
||||
|
||||
|
|
|
|||
|
|
@ -131,13 +131,13 @@ export class ApNoteService {
|
|||
this.logger.debug(`Note fetched: ${JSON.stringify(note, null, 2)}`);
|
||||
|
||||
if (note.id && !checkHttps(note.id)) {
|
||||
throw new Error('unexpected shcema of note.id: ' + note.id);
|
||||
throw new Error('unexpected schema of note.id: ' + note.id);
|
||||
}
|
||||
|
||||
const url = getOneApHrefNullable(note.url);
|
||||
|
||||
if (url && !checkHttps(url)) {
|
||||
throw new Error('unexpected shcema of note url: ' + url);
|
||||
throw new Error('unexpected schema of note url: ' + url);
|
||||
}
|
||||
|
||||
this.logger.info(`Creating the Note: ${note.id}`);
|
||||
|
|
@ -271,24 +271,36 @@ export class ApNoteService {
|
|||
|
||||
const poll = await this.apQuestionService.extractPollFromQuestion(note, resolver).catch(() => undefined);
|
||||
|
||||
return await this.noteCreateService.create(actor, {
|
||||
createdAt: note.published ? new Date(note.published) : null,
|
||||
files,
|
||||
reply,
|
||||
renote: quote,
|
||||
name: note.name,
|
||||
cw,
|
||||
text,
|
||||
localOnly: false,
|
||||
visibility,
|
||||
visibleUsers,
|
||||
apMentions,
|
||||
apHashtags,
|
||||
apEmojis,
|
||||
poll,
|
||||
uri: note.id,
|
||||
url: url,
|
||||
}, silent);
|
||||
try {
|
||||
return await this.noteCreateService.create(actor, {
|
||||
createdAt: note.published ? new Date(note.published) : null,
|
||||
files,
|
||||
reply,
|
||||
renote: quote,
|
||||
name: note.name,
|
||||
cw,
|
||||
text,
|
||||
localOnly: false,
|
||||
visibility,
|
||||
visibleUsers,
|
||||
apMentions,
|
||||
apHashtags,
|
||||
apEmojis,
|
||||
poll,
|
||||
uri: note.id,
|
||||
url: url,
|
||||
}, silent);
|
||||
} catch (err: any) {
|
||||
if (err.name !== 'duplicated') {
|
||||
throw err;
|
||||
}
|
||||
this.logger.info('The note is already inserted while creating itself, reading again');
|
||||
const duplicate = await this.fetchNote(value);
|
||||
if (!duplicate) {
|
||||
throw new Error('The note creation failed with duplication error even when there is no duplication');
|
||||
}
|
||||
return duplicate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,18 +3,54 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
// 与えられた拡張子とファイル名が一致しているかどうかを確認し、
|
||||
// 一致していない場合は拡張子を付与して返す
|
||||
/**
|
||||
* Array.includes()よりSet.has()の方が高速
|
||||
*/
|
||||
const targetExtsToSkip = new Set([
|
||||
'.gz',
|
||||
'.tar',
|
||||
'.tgz',
|
||||
'.bz2',
|
||||
'.xz',
|
||||
'.zip',
|
||||
'.7z',
|
||||
]);
|
||||
|
||||
const extRegExp = /\.[0-9a-zA-Z]+$/i;
|
||||
|
||||
/**
|
||||
* 与えられた拡張子とファイル名が一致しているかどうかを確認し、
|
||||
* 一致していない場合は拡張子を付与して返す
|
||||
*
|
||||
* extはfile-typeのextを想定
|
||||
*/
|
||||
export function correctFilename(filename: string, ext: string | null) {
|
||||
const dotExt = ext ? ext.startsWith('.') ? ext : `.${ext}` : '.unknown';
|
||||
if (filename.endsWith(dotExt)) {
|
||||
return filename;
|
||||
}
|
||||
if (ext === 'jpg' && filename.endsWith('.jpeg')) {
|
||||
return filename;
|
||||
}
|
||||
if (ext === 'tif' && filename.endsWith('.tiff')) {
|
||||
const dotExt = ext ? ext[0] === '.' ? ext : `.${ext}` : '.unknown';
|
||||
|
||||
const match = extRegExp.exec(filename);
|
||||
if (!match || !match[0]) {
|
||||
// filenameが拡張子を持っていない場合は拡張子をつける
|
||||
return `${filename}${dotExt}`;
|
||||
}
|
||||
|
||||
const filenameExt = match[0].toLowerCase();
|
||||
if (
|
||||
// 未知のファイル形式かつ拡張子がある場合は何もしない
|
||||
ext === null ||
|
||||
// 拡張子が一致している場合は何もしない
|
||||
filenameExt === dotExt ||
|
||||
|
||||
// jpeg, tiffを同一視
|
||||
dotExt === '.jpg' && filenameExt === '.jpeg' ||
|
||||
dotExt === '.tif' && filenameExt === '.tiff' ||
|
||||
|
||||
// 圧縮形式っぽければ下手に拡張子を変えない
|
||||
// https://github.com/misskey-dev/misskey/issues/11482
|
||||
targetExtsToSkip.has(dotExt)
|
||||
) {
|
||||
return filename;
|
||||
}
|
||||
|
||||
// 拡張子があるが一致していないなどの場合は拡張子を付け足す
|
||||
return `${filename}${dotExt}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
.andWhere('userListJoining.userListId = :userListId', { userListId: list.id });
|
||||
|
||||
this.queryService.generateVisibilityQuery(query, me);
|
||||
this.queryService.generateMutedUserQuery(query, me);
|
||||
this.queryService.generateMutedNoteQuery(query, me);
|
||||
this.queryService.generateBlockedUserQuery(query, me);
|
||||
this.queryService.generateMutedUserRenotesQueryForNotes(query, me);
|
||||
|
||||
if (ps.includeMyRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
|
|
|
|||
|
|
@ -259,6 +259,21 @@ describe('ActivityPub', () => {
|
|||
assert.strictEqual(note.text, 'test test foo');
|
||||
assert.strictEqual(note.uri, actor2Note.id);
|
||||
});
|
||||
|
||||
test('Fetch a note that is a featured note of the attributed actor', async () => {
|
||||
const actor = createRandomActor();
|
||||
actor.featured = `${actor.id}/collections/featured`;
|
||||
|
||||
const featured = createRandomFeaturedCollection(actor, 5);
|
||||
const firstNote = (featured.items as NonTransientIPost[])[0];
|
||||
|
||||
resolver.register(actor.id, actor);
|
||||
resolver.register(actor.featured, featured);
|
||||
resolver.register(firstNote.id, firstNote);
|
||||
|
||||
const note = await noteService.createNote(firstNote.id as string, resolver);
|
||||
assert.strictEqual(note?.uri, firstNote.id);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Images', () => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { correctFilename } from '@/misc/correct-filename.js';
|
||||
|
||||
describe(correctFilename, () => {
|
||||
it('no ext to null', () => {
|
||||
expect(correctFilename('test', null)).toBe('test.unknown');
|
||||
});
|
||||
it('no ext to jpg', () => {
|
||||
expect(correctFilename('test', 'jpg')).toBe('test.jpg');
|
||||
});
|
||||
it('jpg to webp', () => {
|
||||
expect(correctFilename('test.jpg', 'webp')).toBe('test.jpg.webp');
|
||||
});
|
||||
it('jpg to .webp', () => {
|
||||
expect(correctFilename('test.jpg', '.webp')).toBe('test.jpg.webp');
|
||||
});
|
||||
it('jpeg to jpg', () => {
|
||||
expect(correctFilename('test.jpeg', 'jpg')).toBe('test.jpeg');
|
||||
});
|
||||
it('JPEG to jpg', () => {
|
||||
expect(correctFilename('test.JPEG', 'jpg')).toBe('test.JPEG');
|
||||
});
|
||||
it('jpg to jpg', () => {
|
||||
expect(correctFilename('test.jpg', 'jpg')).toBe('test.jpg');
|
||||
});
|
||||
it('JPG to jpg', () => {
|
||||
expect(correctFilename('test.JPG', 'jpg')).toBe('test.JPG');
|
||||
});
|
||||
it('tiff to tif', () => {
|
||||
expect(correctFilename('test.tiff', 'tif')).toBe('test.tiff');
|
||||
});
|
||||
it('skip gz', () => {
|
||||
expect(correctFilename('test.unitypackage', 'gz')).toBe('test.unitypackage');
|
||||
});
|
||||
it('skip text file', () => {
|
||||
expect(correctFilename('test.txt', null)).toBe('test.txt');
|
||||
});
|
||||
it('unknown', () => {
|
||||
expect(correctFilename('test.hoge', null)).toBe('test.hoge');
|
||||
});
|
||||
test('non ascii with space', () => {
|
||||
expect(correctFilename('ファイル 名前', 'jpg')).toBe('ファイル 名前.jpg');
|
||||
});
|
||||
});
|
||||
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
import { describe, test, expect } from '@jest/globals';
|
||||
import { contentDisposition } from '@/misc/content-disposition.js';
|
||||
import { correctFilename } from '@/misc/correct-filename.js';
|
||||
|
||||
describe('misc:content-disposition', () => {
|
||||
test('inline', () => {
|
||||
|
|
@ -18,30 +17,3 @@ describe('misc:content-disposition', () => {
|
|||
expect(contentDisposition('attachment', 'ファイル名')).toBe('attachment; filename=\"_____\"; filename*=UTF-8\'\'%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D');
|
||||
});
|
||||
});
|
||||
|
||||
describe('misc:correct-filename', () => {
|
||||
test('simple', () => {
|
||||
expect(correctFilename('filename', 'jpg')).toBe('filename.jpg');
|
||||
});
|
||||
test('with same ext', () => {
|
||||
expect(correctFilename('filename.jpg', 'jpg')).toBe('filename.jpg');
|
||||
});
|
||||
test('.ext', () => {
|
||||
expect(correctFilename('filename.jpg', '.jpg')).toBe('filename.jpg');
|
||||
});
|
||||
test('with different ext', () => {
|
||||
expect(correctFilename('filename.webp', 'jpg')).toBe('filename.webp.jpg');
|
||||
});
|
||||
test('non ascii with space', () => {
|
||||
expect(correctFilename('ファイル 名前', 'jpg')).toBe('ファイル 名前.jpg');
|
||||
});
|
||||
test('jpeg', () => {
|
||||
expect(correctFilename('filename.jpeg', 'jpg')).toBe('filename.jpeg');
|
||||
});
|
||||
test('tiff', () => {
|
||||
expect(correctFilename('filename.tiff', 'tif')).toBe('filename.tiff');
|
||||
});
|
||||
test('null ext', () => {
|
||||
expect(correctFilename('filename', null)).toBe('filename.unknown');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitchButton :class="$style.switchButton" :checked="item.ref" :disabled="item.disabled" @toggle="switchItem(item)" />
|
||||
<span :class="$style.switchText">{{ item.text }}</span>
|
||||
</button>
|
||||
<button v-else-if="item.type === 'parent'" role="menuitem" :tabindex="i" class="_button" :class="[$style.item, $style.parent, { [$style.childShowing]: childShowingItem === item }]" @mouseenter="showChildren(item, $event)">
|
||||
<div v-else-if="item.type === 'parent'" role="menuitem" :tabindex="i" :class="[$style.item, $style.parent, { [$style.childShowing]: childShowingItem === item }]" @mouseenter="preferClick ? null : showChildren(item, $event)" @click="!preferClick ? null : showChildren(item, $event)">
|
||||
<i v-if="item.icon" class="ti-fw" :class="[$style.icon, item.icon]"></i>
|
||||
<span>{{ item.text }}</span>
|
||||
<span :class="$style.caret"><i class="ti ti-chevron-right ti-fw"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
<button v-else :tabindex="i" class="_button" role="menuitem" :class="[$style.item, { [$style.danger]: item.danger, [$style.active]: item.active }]" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
|
||||
<i v-if="item.icon" class="ti-fw" :class="[$style.icon, item.icon]"></i>
|
||||
<MkAvatar v-if="item.avatar" :user="item.avatar" :class="$style.avatar"/>
|
||||
|
|
@ -56,19 +56,24 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</span>
|
||||
</div>
|
||||
<div v-if="childMenu">
|
||||
<XChild ref="child" :items="childMenu" :targetElement="childTarget" :rootElement="itemsEl" showing @actioned="childActioned"/>
|
||||
<XChild ref="child" :items="childMenu" :targetElement="childTarget" :rootElement="itemsEl" showing @actioned="childActioned" @close="close(false)"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
<script lang="ts">
|
||||
import { Ref, defineAsyncComponent, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { focusPrev, focusNext } from '@/scripts/focus';
|
||||
import MkSwitchButton from '@/components/MkSwitch.button.vue';
|
||||
import { MenuItem, InnerMenuItem, OuterMenuItem, MenuPending, MenuAction, MenuSwitch, MenuParent } from '@/types/menu';
|
||||
import { MenuItem, InnerMenuItem, MenuPending, MenuAction, MenuSwitch, MenuParent } from '@/types/menu';
|
||||
import * as os from '@/os';
|
||||
import { i18n } from '@/i18n';
|
||||
import { isTouchUsing } from '@/scripts/touch';
|
||||
|
||||
const childrenCache = new WeakMap<MenuParent, MenuItem[]>();
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const XChild = defineAsyncComponent(() => import('./MkMenu.child.vue'));
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
@ -99,6 +104,8 @@ let keymap = $computed(() => ({
|
|||
|
||||
let childShowingItem = $ref<MenuItem | null>();
|
||||
|
||||
let preferClick = isTouchUsing || props.asDrawer;
|
||||
|
||||
watch(() => props.items, () => {
|
||||
const items: (MenuItem | MenuPending)[] = [...props.items].filter(item => item !== undefined);
|
||||
|
||||
|
|
@ -118,7 +125,7 @@ watch(() => props.items, () => {
|
|||
immediate: true,
|
||||
});
|
||||
|
||||
let childMenu = ref<MenuItem[] | null>();
|
||||
const childMenu = ref<MenuItem[] | null>();
|
||||
let childTarget = $shallowRef<HTMLElement | null>();
|
||||
|
||||
function closeChild() {
|
||||
|
|
@ -131,11 +138,11 @@ function childActioned() {
|
|||
close(true);
|
||||
}
|
||||
|
||||
function onGlobalMousedown(event: MouseEvent) {
|
||||
const onGlobalMousedown = (event: MouseEvent) => {
|
||||
if (childTarget && (event.target === childTarget || childTarget.contains(event.target))) return;
|
||||
if (child && child.checkHit(event)) return;
|
||||
closeChild();
|
||||
}
|
||||
};
|
||||
|
||||
let childCloseTimer: null | number = null;
|
||||
function onItemMouseEnter(item) {
|
||||
|
|
@ -147,35 +154,30 @@ function onItemMouseLeave(item) {
|
|||
if (childCloseTimer) window.clearTimeout(childCloseTimer);
|
||||
}
|
||||
|
||||
let childrenCache = new WeakMap<MenuParent, OuterMenuItem[]>();
|
||||
async function showChildren(item: MenuParent, ev: MouseEvent) {
|
||||
const children = ref<OuterMenuItem[]>([]);
|
||||
if (childrenCache.has(item)) {
|
||||
children.value = childrenCache.get(item)!;
|
||||
} else {
|
||||
if (typeof item.children === 'function') {
|
||||
children.value = [{
|
||||
type: 'pending',
|
||||
}];
|
||||
Promise.resolve(item.children()).then(x => {
|
||||
children.value = x;
|
||||
childrenCache.set(item, x);
|
||||
});
|
||||
const children = await (async () => {
|
||||
if (childrenCache.has(item)) {
|
||||
return childrenCache.get(item)!;
|
||||
} else {
|
||||
children.value = item.children;
|
||||
if (typeof item.children === 'function') {
|
||||
return Promise.resolve(item.children());
|
||||
} else {
|
||||
return item.children;
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
childrenCache.set(item, children);
|
||||
|
||||
if (props.asDrawer) {
|
||||
os.popupMenu(children, ev.currentTarget ?? ev.target, {
|
||||
onClosing: () => {
|
||||
close();
|
||||
}
|
||||
os.popupMenu(children, ev.currentTarget ?? ev.target).finally(() => {
|
||||
emit('close');
|
||||
});
|
||||
emit('hide');
|
||||
} else {
|
||||
childTarget = ev.currentTarget ?? ev.target;
|
||||
childMenu = children;
|
||||
// これでもリアクティビティは保たれる
|
||||
childMenu.value = children;
|
||||
childShowingItem = item;
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +207,7 @@ function switchItem(item: MenuSwitch & { ref: any }) {
|
|||
onMounted(() => {
|
||||
if (props.viaKeyboard) {
|
||||
nextTick(() => {
|
||||
focusNext(itemsEl.children[0], true, false);
|
||||
if (itemsEl) focusNext(itemsEl.children[0], true, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -353,6 +355,7 @@ onBeforeUnmount(() => {
|
|||
}
|
||||
|
||||
&.parent {
|
||||
pointer-events: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: default;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<MkModal ref="modal" v-slot="{ type, maxHeight }" :zPriority="'high'" :src="src" :transparentBg="true" @click="close" @close="emit('closing')" @closed="emit('closed')">
|
||||
<MkMenu :items="items" :align="align" :width="width" :max-height="maxHeight" :asDrawer="type === 'drawer'" :class="{ [$style.drawer]: type === 'drawer' }" @close="close" @hide="manualShowing = false"/>
|
||||
<MkModal ref="modal" v-slot="{ type, maxHeight }" :manualShowing="manualShowing" :zPriority="'high'" :src="src" :transparentBg="true" @click="click" @close="onModalClose" @closed="onModalClosed">
|
||||
<MkMenu :items="items" :align="align" :width="width" :max-height="maxHeight" :asDrawer="type === 'drawer'" :class="{ [$style.drawer]: type === 'drawer' }" @close="onMenuClose" @hide="hide"/>
|
||||
</MkModal>
|
||||
</template>
|
||||
|
||||
|
|
@ -30,11 +30,44 @@ const emit = defineEmits<{
|
|||
|
||||
let modal = $shallowRef<InstanceType<typeof MkModal>>();
|
||||
const manualShowing = ref(true);
|
||||
const hiding = ref(false);
|
||||
|
||||
function click() {
|
||||
close();
|
||||
}
|
||||
|
||||
function onModalClose() {
|
||||
emit('closing');
|
||||
}
|
||||
|
||||
function onMenuClose() {
|
||||
close();
|
||||
if (hiding.value) {
|
||||
// hidingであればclosedを発火
|
||||
emit('closed');
|
||||
}
|
||||
}
|
||||
|
||||
function onModalClosed() {
|
||||
if (!hiding.value) {
|
||||
// hidingでなければclosedを発火
|
||||
emit('closed');
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
manualShowing.value = false;
|
||||
hiding.value = true;
|
||||
|
||||
// closeは呼ぶ必要がある
|
||||
modal?.close();
|
||||
}
|
||||
|
||||
function close() {
|
||||
if (!modal) return;
|
||||
manualShowing.value = false;
|
||||
modal.close();
|
||||
|
||||
// closeは呼ぶ必要がある
|
||||
modal?.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { Note, UserLite, DriveFile } from "misskey-js/built/entities";
|
||||
import { Ref, ref, ComputedRef, computed, watch } from "vue";
|
||||
import { Ref, ref, ComputedRef, computed, watch, triggerRef } from "vue";
|
||||
import { api } from "./api";
|
||||
import { useStream } from '@/stream';
|
||||
import { Stream } from "misskey-js";
|
||||
|
|
@ -314,7 +314,6 @@ export class NoteManager {
|
|||
if (this.isDebuggerEnabled) console.log('NoteManager: onStreamNoteUpdated (not found)', id, note?.value);
|
||||
this.connection?.send('un', { id });
|
||||
this.captureing.delete(id);
|
||||
this.notesComputed.delete(id);
|
||||
this.updatedAt.delete(id);
|
||||
return;
|
||||
} else {
|
||||
|
|
@ -384,7 +383,6 @@ export class NoteManager {
|
|||
note.value = null;
|
||||
this.connection?.send('un', { id });
|
||||
this.captureing.delete(id);
|
||||
this.notesComputed.delete(id);
|
||||
this.updatedAt.delete(id);
|
||||
break;
|
||||
}
|
||||
|
|
@ -394,6 +392,7 @@ export class NoteManager {
|
|||
if (type !== 'deleted') {
|
||||
if (!note.value) throw new Error('NoteManager: onStreamNoteUpdated (update) note.value is null');
|
||||
note.value = { ...note.value, ...diff };
|
||||
triggerRef(note);
|
||||
}
|
||||
this.updatedAt.set(id, Date.now());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,7 +417,9 @@ export function getNoteMenu(props: {
|
|||
|
||||
const cleanup = () => {
|
||||
if (_DEV_) console.log('note menu cleanup', cleanups);
|
||||
cleanups.forEach(cleanup => cleanup());
|
||||
for (const cl of cleanups) {
|
||||
cl();
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -330,7 +330,9 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
|
|||
|
||||
const cleanup = () => {
|
||||
if (_DEV_) console.log('user menu cleanup', cleanups);
|
||||
cleanups.forEach(cleanup => cleanup());
|
||||
for (const cl of cleanups) {
|
||||
cl();
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ html {
|
|||
line-height: 1.35;
|
||||
text-size-adjust: 100%;
|
||||
tab-size: 2;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
|
||||
&, * {
|
||||
scrollbar-color: var(--scrollbarHandle) transparent;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export type MenuA = { type: 'a', href: string, target?: string, download?: strin
|
|||
export type MenuUser = { type: 'user', user: Misskey.entities.User, active?: boolean, indicate?: boolean, action: MenuAction };
|
||||
export type MenuSwitch = { type: 'switch', ref: Ref<boolean>, text: string, disabled?: boolean };
|
||||
export type MenuButton = { type?: 'button', text: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean, avatar?: Misskey.entities.User; action: MenuAction };
|
||||
export type MenuParent = { type: 'parent', text: string, icon?: string, children: OuterMenuItem[] | (() => Promise<OuterMenuItem[]> | OuterMenuItem[]) };
|
||||
export type MenuParent = { type: 'parent', text: string, icon?: string, children: MenuItem[] | (() => Promise<MenuItem[]> | MenuItem[]) };
|
||||
|
||||
export type MenuPending = { type: 'pending' };
|
||||
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ importers:
|
|||
version: 2.1.0
|
||||
summaly:
|
||||
specifier: github:misskey-dev/summaly
|
||||
version: github.com/misskey-dev/summaly/089a0ad8e8c780e5c088b1c528aa95c5827cbdcc
|
||||
version: github.com/misskey-dev/summaly/d2d8db49943ccb201c1b1b283e9d0a630519fac7
|
||||
systeminformation:
|
||||
specifier: 5.18.9
|
||||
version: 5.18.9
|
||||
|
|
@ -1000,7 +1000,7 @@ importers:
|
|||
version: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.0.27)(@storybook/components@7.1.0)(@storybook/core-events@7.0.27)(@storybook/manager-api@7.0.27)(@storybook/preview-api@7.0.27)(@storybook/theming@7.0.27)(@storybook/types@7.0.27)(react-dom@18.2.0)(react@18.2.0)
|
||||
summaly:
|
||||
specifier: github:misskey-dev/summaly
|
||||
version: github.com/misskey-dev/summaly/089a0ad8e8c780e5c088b1c528aa95c5827cbdcc
|
||||
version: github.com/misskey-dev/summaly/d2d8db49943ccb201c1b1b283e9d0a630519fac7
|
||||
vite-plugin-turbosnap:
|
||||
specifier: 1.0.2
|
||||
version: 1.0.2
|
||||
|
|
@ -5348,7 +5348,7 @@ packages:
|
|||
hasBin: true
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
detect-libc: 2.0.1
|
||||
detect-libc: 2.0.2
|
||||
https-proxy-agent: 5.0.1
|
||||
make-dir: 3.1.0
|
||||
node-fetch: 2.6.11
|
||||
|
|
@ -11499,13 +11499,6 @@ packages:
|
|||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/detect-libc@2.0.1:
|
||||
resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==}
|
||||
engines: {node: '>=8'}
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/detect-libc@2.0.2:
|
||||
resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==}
|
||||
engines: {node: '>=8'}
|
||||
|
|
@ -22136,8 +22129,8 @@ packages:
|
|||
react-dom: 18.2.0(react@18.2.0)
|
||||
dev: true
|
||||
|
||||
github.com/misskey-dev/summaly/089a0ad8e8c780e5c088b1c528aa95c5827cbdcc:
|
||||
resolution: {tarball: https://codeload.github.com/misskey-dev/summaly/tar.gz/089a0ad8e8c780e5c088b1c528aa95c5827cbdcc}
|
||||
github.com/misskey-dev/summaly/d2d8db49943ccb201c1b1b283e9d0a630519fac7:
|
||||
resolution: {tarball: https://codeload.github.com/misskey-dev/summaly/tar.gz/d2d8db49943ccb201c1b1b283e9d0a630519fac7}
|
||||
name: summaly
|
||||
version: 4.0.2
|
||||
dependencies:
|
||||
|
|
|
|||
Loading…
Reference in New Issue