Read default value for sensitive and nsfw from API response

This commit is contained in:
AkiraFukushima 2023-02-08 00:17:47 +09:00
parent 3a8473b670
commit 90710d2401
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 8 additions and 2 deletions

View File

@ -207,8 +207,14 @@ export default defineComponent({
const c = generator(s.sns, s.baseURL, a.accessToken, userAgent.value)
client.value = c
const res = await c.getInstanceCustomEmojis()
const customEmojis = res.data
const credentials = await c.verifyAccountCredentials()
if (credentials.data.source) {
visibility.value = credentials.data.source.privacy
nsfw.value = credentials.data.source.sensitive
}
const emojis = await c.getInstanceCustomEmojis()
const customEmojis = emojis.data
.map(emoji => {
return {
name: `:${emoji.shortcode}:`,