This commit is contained in:
tamaina 2021-02-13 03:05:40 +09:00
parent 34ad95befa
commit 11288fd5c8
2 changed files with 20 additions and 11 deletions

View file

@ -116,6 +116,11 @@ export default defineComponent({
type: Boolean,
required: false
},
visibleUsers: {
type: Array,
required: false,
default: () => []
},
initialNote: {
type: Object,
required: false
@ -149,7 +154,6 @@ export default defineComponent({
cw: null,
localOnly: this.$store.state.rememberNoteVisibility ? this.$store.state.localOnly : this.$store.state.defaultNoteLocalOnly,
visibility: (this.$store.state.rememberNoteVisibility ? this.$store.state.visibility : this.$store.state.defaultNoteVisibility) as typeof noteVisibilities[number],
visibleUsers: [],
autocomplete: null,
draghover: false,
quoteId: null,

View file

@ -54,6 +54,7 @@ export default defineComponent({
visibility: null as string | null,
localOnly: null as boolean | null,
files: null as any[] | null,
visibleUsers: [] as any[],
faShareAlt
}
@ -112,16 +113,20 @@ export default defineComponent({
this.renote = obj.object;
}
}
})(),(async () => {
const specifiedId = urlParams.get('specifiedId');
const specifiedAcct = urlParams.get('specifiedAcct');
if (specifiedId) {
this.specified = await os.api('users/show', {
userId: specifiedId
});
} else if (specifiedAcct) {
this.specified = await os.api('users/show', parseAcct(specifiedAcct));
}
})(),(() => {
const visibleUserIds = urlParams.get('visibleUserIds');
if (!visibleUserIds) return;
return Promise.all(visibleUserIds.split(',')
.map(userId => os.api('users/show', { userId })
.then(user => this.visibleUsers.push(user))
.catch(() => Error(`invalid userId: ${userId}`))));
})(),(() => {
const visibleAccts = urlParams.get('visibleAccts');
if (!visibleAccts) return;
return Promise.all(visibleAccts.split(',')
.map(acct => os.api('users/show', parseAcct(acct))
.then(user => this.visibleUsers.push(user))
.catch(() => Error(`invalid acct: ${acct}`))));
})(),(async () => {
const fileIds = urlParams.get('fileIds');
if (fileIds) {