Skip to content

Commit

Permalink
release: v2024.3.1-kakurega.1.33.1 (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
hideki0403 authored Mar 12, 2024
2 parents 7e10ab2 + 75e9c29 commit 6a09b9a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG_KAKUREGA.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.33.1
Release: 2024/03/13
Base: 2024.3.1

### 修正
- モバイルレイアウトの場合にアクティビティの非表示設定が反映されない問題を修正
- リモートのリアクションを押した際の挙動を修正
- リアクションをしてある状態でリモートのリアクションを押すと、ハートのリアクションになってしまう問題を修正
- リモートのリアクションを押すことでも、該当するリアクションの解除/変更が行えるように
- リアクションが押せない状態でもエフェクトが出る問題を修正

## 1.33.0
Release: 2024/03/11
Base: 2024.3.1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "2024.3.1-kakurega.1.33.0",
"version": "2024.3.1-kakurega.1.33.1",
"codename": "nasubi",
"repository": {
"type": "git",
Expand Down
40 changes: 21 additions & 19 deletions packages/frontend/src/components/MkReactionsViewer.reaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<button
ref="buttonEl"
v-ripple="canToggle || targetEmoji"
v-ripple="canToggle"
class="_button"
:class="[$style.root, { [$style.reacted]: note.myReaction == reaction, [$style.canToggle]: canToggle, [$style.canToggleFallback]: targetEmoji, [$style.small]: defaultStore.state.reactionsDisplaySize === 'small', [$style.large]: defaultStore.state.reactionsDisplaySize === 'large' }]"
:class="[$style.root, { [$style.reacted]: note.myReaction == reaction, [$style.canToggle]: (isLocal && canToggle), [$style.canToggleFallback]: (!isLocal && isAvailable), [$style.small]: defaultStore.state.reactionsDisplaySize === 'small', [$style.large]: defaultStore.state.reactionsDisplaySize === 'large' }]"
@click="toggleReaction()"
@contextmenu.prevent.stop="menu"
>
Expand Down Expand Up @@ -54,59 +54,61 @@ const buttonEl = shallowRef<HTMLElement>();
const emojiName = computed(() => props.reaction.replace(/:/g, '').replace(/@\./, ''));
const emoji = computed(() => customEmojisMap.get(emojiName.value) ?? getUnicodeEmoji(props.reaction));

function getReactionName(reaction: string, formated = false) {
const r = reaction.replaceAll(':', '').replace(/@.*/, '');
return formated ? `:${r}:` : r;
}

const isLocal = computed(() => !props.reaction.match(/@\w/));
const isAvailable = computed(() => isLocal.value ? true : customEmojisMap.has(getReactionName(props.reaction)));

const canToggle = computed(() => {
return !props.reaction.match(/@\w/) && $i && emoji.value && checkReactionPermissions($i, props.note, emoji.value);
return isAvailable.value && $i && emoji.value && checkReactionPermissions($i, props.note, emoji.value);
});
const canGetInfo = computed(() => !props.reaction.match(/@\w/) && props.reaction.includes(':'));

const reactionName = computed(() => {
const r = props.reaction.replace(':', '');
return r.slice(0, r.indexOf('@'));
});

const targetEmoji = computed(() => customEmojisMap.get(reactionName.value)?.name ?? null);

async function toggleReaction() {
if (!canToggle.value && !targetEmoji.value) return;
if (!canToggle.value) return;

const oldReaction = props.note.myReaction;
const reaction = getReactionName(props.reaction, true);
const oldReaction = props.note.myReaction ? getReactionName(props.note.myReaction, true) : null;
if (oldReaction) {
const confirm = await os.confirm({
type: 'warning',
text: oldReaction !== props.reaction ? i18n.ts.changeReactionConfirm : i18n.ts.cancelReactionConfirm,
text: oldReaction !== reaction ? i18n.ts.changeReactionConfirm : i18n.ts.cancelReactionConfirm,
});
if (confirm.canceled) return;

if (oldReaction !== props.reaction) {
if (oldReaction !== reaction) {
sound.playMisskeySfx('reaction');
}

if (mock) {
emit('reactionToggled', props.reaction, (props.count - 1));
emit('reactionToggled', reaction, (props.count - 1));
return;
}

misskeyApi('notes/reactions/delete', {
noteId: props.note.id,
}).then(() => {
if (oldReaction !== props.reaction) {
if (oldReaction !== reaction) {
misskeyApi('notes/reactions/create', {
noteId: props.note.id,
reaction: props.reaction,
reaction: reaction,
});
}
});
} else {
sound.playMisskeySfx('reaction');

if (mock) {
emit('reactionToggled', props.reaction, (props.count + 1));
emit('reactionToggled', reaction, (props.count + 1));
return;
}

misskeyApi('notes/reactions/create', {
noteId: props.note.id,
reaction: canToggle.value ? props.reaction : `:${targetEmoji.value}:`,
reaction: reaction,
});

if (props.note.text && props.note.text.length > 100 && (Date.now() - new Date(props.note.createdAt).getTime() < 1000 * 3)) {
Expand Down
12 changes: 0 additions & 12 deletions packages/frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
<head>
<meta charset="UTF-8" />
<title>[DEV] Loading...</title>
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self' https://newassets.hcaptcha.com/ https://challenges.cloudflare.com/ http://localhost:7493/;
worker-src 'self';
script-src 'self' 'unsafe-eval' https://*.hcaptcha.com https://challenges.cloudflare.com;
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob: www.google.com xn--931a.moe localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000;
media-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000;
connect-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000 https://newassets.hcaptcha.com;
frame-src *;"
/>
<meta property="og:site_name" content="[DEV BUILD] Misskey" />
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/user/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<XFiles :key="user.id" :user="user"/>
</MkLazy>
<MkLazy>
<XActivity :key="user.id" :user="user"/>
<XActivity v-if="!user.hideActivity" :key="user.id" :user="user"/>
</MkLazy>
</template>
<div v-if="!disableNotes">
Expand Down

0 comments on commit 6a09b9a

Please sign in to comment.