Skip to content

Commit

Permalink
Merge pull request #843 from setlife-network/or/issue-842/send-bonuse…
Browse files Browse the repository at this point in the history
…s-button-not-show-UI

Send bonuses button does not show in UI
  • Loading branch information
otech47 committed Jul 5, 2023
2 parents 56a79ce + 22b2085 commit f5e5426
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ BTCPAYSERVER_WALLET_ID=
BTCPAYSERVER_SECRET=
OAUTH_REDIRECT_NEW_USERS=
OAUTH_REDIRECT_EXISTING_USERS=
TEMP_AUTHORIZED_SUPERUSER_ID=

# Frontend environment variables (/src)
# require `REACT_APP_` prefix
REACT_APP_API_URL=localhost:6001
REACT_APP_SITE_URL=localhost:6002
REACT_APP_TEMP_AUTHORIZED_SUPERUSER_ID=

# Required only for running tests
TESTCAFE_ROLE_GITHUB_EMAIL=
Expand Down
2 changes: 1 addition & 1 deletion api/config/constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('dotenv').config()

module.exports = {
TEMP_AUTHORIZED_SUPERUSER_ID: process.env.TEMP_AUTHORIZED_SUPERUSER_ID,
TEMP_AUTHORIZED_SUPERUSER_ID: process.env.REACT_APP_TEMP_AUTHORIZED_SUPERUSER_ID,
GITHUB_OAUTH_URL: 'https://github.com/login/oauth/access_token',
INVOICELY_CSV_PATH: `${process.env.INVOICELY_CSV_PATH}`,
SITE_ROOT: process.env.NODE_ENV == 'production'
Expand Down
5 changes: 4 additions & 1 deletion api/schema/resolvers/PaymentResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ module.exports = {
}
},
sendPayment: async (root, { contributors }, { cookies, models }) => {
if (cookies.userSession === TEMP_AUTHORIZED_SUPERUSER_ID) {
if (
cookies.userSession &&
cookies.userSession.toString() === TEMP_AUTHORIZED_SUPERUSER_ID?.toString()
) {
const results = []
const onChainAddresses = []

Expand Down
4 changes: 3 additions & 1 deletion srcv2/pages/ProjectDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const ProjectDetailPage = (props) => {
const [openAddContributorOverlay, setOpenAddContributorOverlay] = useState(false)
const [screenIndex, setScreenIndex] = useState(0)

const isSuperUser = process.env.REACT_APP_TEMP_AUTHORIZED_SUPERUSER_ID

const {
data: dataProject,
loading: loadingProject,
Expand Down Expand Up @@ -183,7 +185,7 @@ const ProjectDetailPage = (props) => {
Active Contributors
</p>
</div>
{sessionUser().id === TEMP_AUTHORIZED_SUPERUSER_ID &&
{sessionUser().id == isSuperUser &&
<button
type='button'
className='border-2 border-setlife text-setlife rounded-full py-1 mb-4 w-fit h-fit px-2 ml-auto'
Expand Down

0 comments on commit f5e5426

Please sign in to comment.