-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 絵文字のポップアップメニューに編集を追加 #15004
feat: 絵文字のポップアップメニューに編集を追加 #15004
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,8 @@ SPDX-License-Identifier: AGPL-3.0-only | |
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, inject, ref } from 'vue'; | ||
import { computed, defineAsyncComponent, inject, ref } from 'vue'; | ||
import type { MenuItem } from '@/types/menu.js'; | ||
import { getProxiedImageUrl, getStaticImageUrl } from '@/scripts/media-proxy.js'; | ||
import { defaultStore } from '@/store.js'; | ||
import { customEmojisMap } from '@/custom-emojis.js'; | ||
|
@@ -35,7 +36,7 @@ import { copyToClipboard } from '@/scripts/copy-to-clipboard.js'; | |
import * as sound from '@/scripts/sound.js'; | ||
import { i18n } from '@/i18n.js'; | ||
import MkCustomEmojiDetailedDialog from '@/components/MkCustomEmojiDetailedDialog.vue'; | ||
import type { MenuItem } from '@/types/menu.js'; | ||
import { $i } from '@/account.js'; | ||
|
||
const props = defineProps<{ | ||
name: string; | ||
|
@@ -125,9 +126,30 @@ function onClick(ev: MouseEvent) { | |
}, | ||
}); | ||
|
||
if ($i?.isModerator ?? $i?.isAdmin) { | ||
menuItems.push({ | ||
text: i18n.ts.edit, | ||
icon: 'ti ti-pencil', | ||
action: () => { | ||
edit(props.name); | ||
}, | ||
}); | ||
} | ||
|
||
os.popupMenu(menuItems, ev.currentTarget ?? ev.target); | ||
} | ||
} | ||
|
||
const edit = async (name: string) => { | ||
const emoji = await misskeyApiGet('emoji', { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 編集することを考えるとキャッシュされていない方が良いからgetだとアレですね There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. だとしたら既存の編集画面の実装もあわせて修正した方が良さそうですね? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 勘違いでした There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修正しました |
||
name: name, | ||
}); | ||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/pages/emoji-edit-dialog.vue')), { | ||
emoji: emoji, | ||
}, { | ||
closed: () => dispose(), | ||
}); | ||
}; | ||
</script> | ||
|
||
<style lang="scss" module> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
他と揃えてfunctionの方が良さそうです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました