Skip to content

Commit

Permalink
Merge pull request #95 from leejaeseong11/fix-room
Browse files Browse the repository at this point in the history
fix: room out error
  • Loading branch information
qbobl5 authored Dec 21, 2023
2 parents 1c62a4b + 62f2c06 commit 68a7527
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 10 additions & 3 deletions src/components/home/ShowQuizSimply.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="quiz-info-container">
<div class="row">
<div class="col-3">티어</div>
<div class="col-5">제목</div>
<div class="col-4">제목</div>
<div class="col-2">정답률</div>
<div class="col-2">출제자</div>
</div>
Expand Down Expand Up @@ -30,7 +30,7 @@
<div class="col-3" v-else>
{{ quizInfo.quizTier }}
</div>
<div class="col-5">{{ quizInfo.quizTitle }}</div>
<div class="col-4" id="simple-quiz-title">{{ quizInfo.quizTitle }}</div>
<div class="col-2">
{{
quizInfo.quizSubmitCnt == 0
Expand All @@ -45,7 +45,7 @@
</div>
<div id="quiz-content-title">문제 설명</div>
<div id="quiz-content-container">
<pre id="quiz-content">{{ quizInfo.quizContent }}</pre>
<div id="quiz-content">{{ quizInfo.quizContent }}</div>
</div>
</template>
<script>
Expand Down Expand Up @@ -83,10 +83,17 @@ export default {
#quiz-content {
padding: 8px;
white-space: pre-wrap;
overflow: scroll;
font-family: 'DNFBitBitv2';
word-wrap: break-word;
font-size: 1.125rem;
line-height: 1.5rem;
}
#simple-quiz-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
8 changes: 6 additions & 2 deletions src/views/room/WaitingRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default {
if (err.response.data.message == 'ROOM_NOT_FOUND') {
this.$router.push({ path: '/' })
if (this.roomStatus == 1) {
if (this.roomInfo.roomStatus == 1) {
SweetAlert.warning('방이 삭제되었습니다.').then((ok) => {
if (ok.isConfirmed) {
this.$router.go()
Expand Down Expand Up @@ -248,6 +248,7 @@ export default {
apiClient.get(`${this.backURL}/room/${this.roomNo}`).then((res) => {
if (res) {
apiClient.delete(`${this.backURL}/room/${this.roomNo}`).then(async () => {
console.log(res)
const outMessage = {
type: 'ROOM_QUIT',
roomNo: this.roomNo,
Expand All @@ -257,7 +258,8 @@ export default {
this.socket.send(JSON.stringify(outMessage))
// this.socket.close()
}
if (this.roomStatus == 1) {
console.log(this.roomInfo.roomStatus)
if (this.roomInfo.roomStatus == 1) {
SweetAlert.warning('방이 삭제되었습니다.').then((ok) => {
if (ok.isConfirmed) {
if (this.socket.readyState === WebSocket.OPEN) {
Expand Down Expand Up @@ -636,6 +638,8 @@ pre {
}
#room-info-layout {
width: 50%;
display: flex;
flex-direction: column;
}
Expand Down

0 comments on commit 68a7527

Please sign in to comment.