Skip to content

Commit

Permalink
Merge pull request #13 from byeolhaha/feat/2
Browse files Browse the repository at this point in the history
refactor : 외국인 고객인 설문 조사를 하지 않는 경우에 대한 alert 경고 추가
  • Loading branch information
byeolhaha authored Jun 3, 2024
2 parents 8153b86 + d625215 commit ee932fb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Build with gradle
run: ./gradlew build

- name: Docker login
- name: Docker build & push
if: contains(github.ref, 'main')
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
Expand Down
23 changes: 21 additions & 2 deletions src/main/resources/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ document.getElementById("newCustomer").addEventListener("click", function() {
});

document.getElementById("existingCustomer").addEventListener("click", function() {
window.location.href = "/templates/client-chatrooms.html";
userId = getUserIdFromCookie();
if (userId === 0) {
alert("This is your first visit. Please click on the 'No first visit✅' button");
} else {
window.location.href = "/templates/client-chatrooms.html";
}
});

document.getElementsByClassName("close")[0].addEventListener("click", function() {
Expand All @@ -18,4 +23,18 @@ window.addEventListener("click", function(event) {
if (event.target == document.getElementById("myModal")) {
document.getElementById("myModal").style.display = "none";
}
});
});

function getUserIdFromCookie() {
const cookieString = document.cookie;
const cookies = cookieString.split(';');

for (let cookie of cookies) {
const [cookieName, cookieValue] = cookie.split('=');
if (cookieName.trim() === 'userId') {
return parseInt(cookieValue) || 0;
}
}

return 0;
}

0 comments on commit ee932fb

Please sign in to comment.