delete debug logs
This commit is contained in:
parent
3a540dd1f6
commit
ea6f538109
@ -93,7 +93,6 @@ useTooltip(buttonRef, async (showing) => {
|
|||||||
|
|
||||||
const onContextmenu = (e: MouseEvent) => {
|
const onContextmenu = (e: MouseEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log('contextmenu');
|
|
||||||
openReactionImportMenu(e, props.reaction);
|
openReactionImportMenu(e, props.reaction);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -9,8 +9,6 @@ import { CustomEmoji } from 'misskey-js/built/entities';
|
|||||||
|
|
||||||
export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
||||||
|
|
||||||
console.log('openReactionImportMenu', reaction);
|
|
||||||
|
|
||||||
const getEmojiObject = emojiId => new Promise<Record<string, any> | null>(async resolve => {
|
const getEmojiObject = emojiId => new Promise<Record<string, any> | null>(async resolve => {
|
||||||
const sinceId = await os.api('admin/emoji/list', {
|
const sinceId = await os.api('admin/emoji/list', {
|
||||||
limit: 1,
|
limit: 1,
|
||||||
@ -32,7 +30,6 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(id[0]);
|
|
||||||
resolve(id[0]);
|
resolve(id[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -41,9 +38,7 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
|||||||
const isLocal = (emojiName.match(/(?<=@).*\.*(?=:)/g) == null || emojiName.match(/(?<=@).*\.*(?=:)/g)[0] == '.');
|
const isLocal = (emojiName.match(/(?<=@).*\.*(?=:)/g) == null || emojiName.match(/(?<=@).*\.*(?=:)/g)[0] == '.');
|
||||||
if (isLocal) return null;
|
if (isLocal) return null;
|
||||||
const host = emojiName.match(/(?<=@).*\.*(?=:)/g)[0];
|
const host = emojiName.match(/(?<=@).*\.*(?=:)/g)[0];
|
||||||
console.log(host)
|
|
||||||
const name = emojiName.match(/(?<=:).*(?=@.*\.*(?=:))/g)[0];
|
const name = emojiName.match(/(?<=:).*(?=@.*\.*(?=:))/g)[0];
|
||||||
console.log(name)
|
|
||||||
if (!host || !name) return;
|
if (!host || !name) return;
|
||||||
|
|
||||||
|
|
||||||
@ -54,15 +49,12 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const emojiId = await resList.find(emoji => emoji.name == name && emoji.host == host)?.id;
|
const emojiId = await resList.find(emoji => emoji.name == name && emoji.host == host)?.id;
|
||||||
console.log(emojiId);
|
|
||||||
|
|
||||||
return emojiId;
|
return emojiId;
|
||||||
}
|
}
|
||||||
|
|
||||||
const importEmoji = async (emojiName: string) => {
|
const importEmoji = async (emojiName: string) => {
|
||||||
console.log('importEmoji', emojiName);
|
|
||||||
const emojiId = await getEmojiId(emojiName);
|
const emojiId = await getEmojiId(emojiName);
|
||||||
console.log('emojiId: ', await emojiId);
|
|
||||||
if (!await emojiId) return;
|
if (!await emojiId) return;
|
||||||
os.api('admin/emoji/copy', {
|
os.api('admin/emoji/copy', {
|
||||||
emojiId: emojiId,
|
emojiId: emojiId,
|
||||||
@ -73,7 +65,6 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
|||||||
|
|
||||||
if (!($i?.isAdmin || $i?.isModerator)) return;
|
if (!($i?.isAdmin || $i?.isModerator)) return;
|
||||||
if (!reaction) return;
|
if (!reaction) return;
|
||||||
console.log('passed');
|
|
||||||
|
|
||||||
const menuItems: MenuItem[] = [{
|
const menuItems: MenuItem[] = [{
|
||||||
type: 'label',
|
type: 'label',
|
||||||
@ -93,8 +84,6 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
|||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
const emojiId = await getEmojiId(reaction) ? await getEmojiId(reaction) : reaction;
|
const emojiId = await getEmojiId(reaction) ? await getEmojiId(reaction) : reaction;
|
||||||
console.log('emojiId: ', await getEmojiId(reaction));
|
|
||||||
console.log('reaction: ', reaction);
|
|
||||||
if (reaction.startsWith(':') && emojiId) {
|
if (reaction.startsWith(':') && emojiId) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@ -108,14 +97,11 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(await duplication);
|
|
||||||
|
|
||||||
if (await duplication) {
|
if (await duplication) {
|
||||||
os.confirm({
|
os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
text: '同じ名前の絵文字が存在します。インポートしますか?',
|
text: '同じ名前の絵文字が存在します。インポートしますか?',
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res);
|
|
||||||
if (res.canceled) return;
|
if (res.canceled) return;
|
||||||
importEmoji(reaction);
|
importEmoji(reaction);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user