Skip to content

Commit 715a1de

Browse files
committed
remove permission data
1 parent f689df6 commit 715a1de

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/gitment.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,7 @@ class Gitment {
202202
return Promise.resolve({})
203203
}
204204

205-
const { owner, repo } = this
206-
207205
return http.get('/user')
208-
.then(user => {
209-
return http.get(`/repos/${owner}/${repo}/collaborators/${user.login}/permission`)
210-
.then(permission => Object.assign(user, { permission: permission.permission }))
211-
})
212206
.then((user) => {
213207
this.state.user = user
214208
localStorage.setItem(LS_USER_KEY, JSON.stringify(user))

src/theme/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function renderComments({ meta, comments, commentReactions, currentPage, user, e
4747
errorBlock.className = 'gitment-comments-error'
4848

4949
if (error === NOT_INITIALIZED_ERROR
50-
&& (user.permission === 'admin' || user.permission === 'write')) {
50+
&& user.login.toLowerCase() === instance.owner.toLowerCase()) {
5151
const initHint = document.createElement('div')
5252
const initButton = document.createElement('button')
5353
initButton.className = 'gitment-comments-init-btn'

0 commit comments

Comments
 (0)