feat: emojis import

This commit is contained in:
syuilo
2022-01-13 00:47:40 +09:00
parent 1f2dab0a83
commit 7e5e763584
6 changed files with 205 additions and 9 deletions

View File

@ -182,6 +182,26 @@ const menu = (ev: MouseEvent) => {
});
});
}
}, {
icon: 'fas fa-upload',
text: i18n.locale.import,
action: async () => {
const file = await selectFile(ev.currentTarget || ev.target);
os.api('admin/emoji/import-zip', {
fileId: file.id,
})
.then(() => {
os.alert({
type: 'info',
text: i18n.locale.importRequested,
});
}).catch((e) => {
os.alert({
type: 'error',
text: e.message,
});
});
}
}], ev.currentTarget || ev.target);
};