Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: room out error #95

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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