add Akkoma compatibility (tested on IceShrimp)
This commit is contained in:
parent
60e5c3b042
commit
f36f11045e
13 changed files with 28 additions and 12 deletions
|
|
@ -29,7 +29,7 @@ const Announcement = {
|
|||
currentUser: state => state.users.currentUser
|
||||
}),
|
||||
canEditAnnouncement () {
|
||||
return this.currentUser && this.currentUser.privileges.includes('announcements_manage_announcements')
|
||||
return this.currentUser && this.currentUser.privileges?.includes('announcements_manage_announcements')
|
||||
},
|
||||
content () {
|
||||
return this.announcement.content
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const Interactions = {
|
|||
return {
|
||||
allowFollowingMove: this.$store.state.users.currentUser.allow_following_move,
|
||||
filterMode: tabModeDict.mentions,
|
||||
canSeeReports: this.$store.state.users.currentUser.privileges.includes('reports_manage_reports')
|
||||
canSeeReports: this.$store.state.users.currentUser.privileges?.includes('reports_manage_reports')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const ModerationTools = {
|
|||
return this.tagsSet.has(tagName)
|
||||
},
|
||||
privileged (privilege) {
|
||||
return this.$store.state.users.currentUser.privileges.includes(privilege)
|
||||
return this.$store.state.users.currentUser.privileges?.includes(privilege)
|
||||
},
|
||||
toggleTag (tag) {
|
||||
const store = this.$store
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ export const getListEntries = store => store.allLists.map(list => ({
|
|||
iconLetter: list.title[0]
|
||||
}))
|
||||
|
||||
export const getBookmarkFolderEntries = store => store.allFolders.map(folder => ({
|
||||
export const getBookmarkFolderEntries = store => store.allFolders ? store.allFolders.map(folder => ({
|
||||
name: 'bookmark-folder-' + folder.id,
|
||||
routeObject: { name: 'bookmark-folder', params: { id: folder.id } },
|
||||
labelRaw: folder.name,
|
||||
iconEmoji: folder.emoji,
|
||||
iconEmojiUrl: folder.emoji_url,
|
||||
iconLetter: folder.name[0]
|
||||
}))
|
||||
})) : []
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const NotificationsTab = {
|
|||
},
|
||||
canReceiveReports () {
|
||||
if (!this.user) { return false }
|
||||
return this.user.privileges.includes('reports_manage_reports')
|
||||
return this.user.privileges?.includes('reports_manage_reports')
|
||||
},
|
||||
...SharedComputedObject()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ export const BUTTONS = [{
|
|||
if ({ status, loggedIn, currentUser }) {
|
||||
return loggedIn && (
|
||||
status.user.id === currentUser.id ||
|
||||
currentUser.privileges.includes('messages_delete')
|
||||
currentUser.privileges?.includes('messages_delete')
|
||||
)
|
||||
},
|
||||
confirm: ({ getters }) => getters.mergedConfig.modalOnDelete,
|
||||
|
|
|
|||
|
|
@ -134,7 +134,10 @@ export default {
|
|||
},
|
||||
showModerationMenu () {
|
||||
const privileges = this.loggedIn.privileges
|
||||
return this.loggedIn.role === 'admin' || privileges.includes('users_manage_activation_state') || privileges.includes('users_delete') || privileges.includes('users_manage_tags')
|
||||
return this.loggedIn.role === 'admin' ||
|
||||
privileges?.includes('users_manage_activation_state') ||
|
||||
privileges?.includes('users_delete')||
|
||||
privileges?.includes('users_manage_tags')
|
||||
},
|
||||
hasNote () {
|
||||
return this.relationship.note
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue