This commit is contained in:
tamaina 2021-02-13 02:48:32 +09:00
parent 88ec710650
commit 34ad95befa

View file

@ -76,12 +76,6 @@ export default defineComponent({
const visibility = urlParams.get('visibility'); const visibility = urlParams.get('visibility');
if (noteVisibilities.includes(visibility)) { if (noteVisibilities.includes(visibility)) {
this.visibility = visibility; this.visibility = visibility;
} else {
// Mastodon
if (visibility === 'unlisted') this.visibility = 'home';
else if (visibility === 'private') this.visibility = 'followers';
else if (visibility === 'direct') this.visibility = 'specified';
else this.visibility = null;
} }
const localOnly = urlParams.get('localOnly'); const localOnly = urlParams.get('localOnly');
@ -132,10 +126,14 @@ export default defineComponent({
const fileIds = urlParams.get('fileIds'); const fileIds = urlParams.get('fileIds');
if (fileIds) { if (fileIds) {
const promises = Promise.all(fileIds.split(',') const promises = Promise.all(fileIds.split(',')
.map(fileId => os.api('drive/files/show', { fileId }).catch(() => console.error(`invalid fileId: ${fileId}`)))); .map(fileId => os.api('drive/files/show', { fileId }).catch(() => Error(`invalid fileId: ${fileId}`))));
await promises.then(files => this.files = files).catch(() => console.error('invalid fileIds')); await promises.then(files => this.files = files);
} }
})(),]); })(),]).catch(e => os.dialog({
type: 'error',
title: e.message,
text: e.name
}));
this.state = 'writing'; this.state = 'writing';
}, },