Adzukiさんが変更
This commit is contained in:
parent
025dc3d6f9
commit
7d62342477
@ -150,7 +150,8 @@ export default defineComponent({
|
|||||||
const connection = stream.useChannel('main');
|
const connection = stream.useChannel('main');
|
||||||
connection.on('urlUploadFinished', async data => {
|
connection.on('urlUploadFinished', async data => {
|
||||||
if (data.marker === marker) {
|
if (data.marker === marker) {
|
||||||
resolve(await emojiAdd(data.file.id));
|
const fileId = await emojiAdd(data.file.id);
|
||||||
|
resolve(fileId);
|
||||||
connection.dispose();
|
connection.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -161,15 +162,18 @@ export default defineComponent({
|
|||||||
marker
|
marker
|
||||||
});
|
});
|
||||||
|
|
||||||
const emojiAdd = (fileId) => new Promise(async resolve => {
|
//リネーム→登録→登録されたIDを返す
|
||||||
|
const emojiAdd = (fileId) => new Promise<Record<string, any> | null>(async resolve => {
|
||||||
await os.api('drive/files/update', {
|
await os.api('drive/files/update', {
|
||||||
fileId,
|
fileId,
|
||||||
name: this.emojiName + '.png',
|
name: this.emojiName + '.png',
|
||||||
});
|
});
|
||||||
resolve( await os.api('admin/emoji/add', {
|
|
||||||
fileId,
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
const response = await os.api('admin/emoji/add', {
|
||||||
|
fileId,
|
||||||
|
})
|
||||||
|
|
||||||
|
resolve(response);
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user