mirror of
https://github.com/sim1222/misskey.git
synced 2025-05-02 20:27:18 +09:00
fix: return exception when no admin/mod
refix: return exception when no admin/mod
This commit is contained in:
parent
9f409e3ae0
commit
6b5b0eb2fc
@ -14,6 +14,11 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string):
|
|||||||
const isCustom = reaction.startsWith(':');
|
const isCustom = reaction.startsWith(':');
|
||||||
|
|
||||||
const getEmojiObject = (emojiId): Promise<Record<string, any> | null> => new Promise<Record<string, any> | null>(async resolve => {
|
const getEmojiObject = (emojiId): Promise<Record<string, any> | null> => new Promise<Record<string, any> | null>(async resolve => {
|
||||||
|
if (!($i?.isAdmin || $i?.isModerator)) {
|
||||||
|
resolve(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const sinceId = await os.api('admin/emoji/list', {
|
const sinceId = await os.api('admin/emoji/list', {
|
||||||
limit: 1,
|
limit: 1,
|
||||||
untilId: emojiId.id,
|
untilId: emojiId.id,
|
||||||
@ -40,6 +45,7 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string):
|
|||||||
const getEmojiId = async (): Promise<string | null> => {
|
const getEmojiId = async (): Promise<string | null> => {
|
||||||
if (isLocal) return null;
|
if (isLocal) return null;
|
||||||
if (!host || !name) return null;
|
if (!host || !name) return null;
|
||||||
|
if (!($i?.isAdmin || $i?.isModerator)) return null;
|
||||||
|
|
||||||
const resList: Record<string, any>[] = await os.api('admin/emoji/list-remote', {
|
const resList: Record<string, any>[] = await os.api('admin/emoji/list-remote', {
|
||||||
host,
|
host,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user