Skip to content

Commit aa9a24c

Browse files
committed
chore: some tweaks on pgn upload and resetting
1 parent 311cee6 commit aa9a24c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pages/game/new.vue

+10-6
Original file line numberDiff line numberDiff line change
@@ -117,33 +117,35 @@
117117
<v-btn v-if="history.flat().length > 0" color="blue" class="mr-3" @click="downloadPGN($el)">
118118
Download PGN
119119
</v-btn>
120-
<v-dialog v-else v-model="uploadDialog" :persistent="true" width="1024">
120+
<v-dialog v-else v-model="uploadDialog" width="1024">
121121
<template #activator="{ props }">
122122
<v-btn color="lime" class="mr-3" v-bind="props">
123123
Upload PGN
124124
</v-btn>
125125
</template>
126-
<v-card>
126+
<v-card height="576">
127127
<v-card-title>
128128
<span class="text-h5">Upload PGN</span>
129129
</v-card-title>
130130
<v-card-text>
131131
<v-container>
132132
<!-- big ol text box -->
133-
<v-textarea v-model="pgn" label="PGN" />
133+
<v-textarea v-model="pgn" rows="12" label="PGN" />
134134
<!-- tiny file upload box -->
135-
<v-file-input v-model="pgnFile" label="PGN File" />
135+
<v-file-input v-model="pgnFile" label="PGN File" prepend-icon="mdi-upload" />
136136
</v-container>
137137
</v-card-text>
138138
<v-card-actions>
139139
<v-spacer />
140+
<v-btn text="Cancel" @click="uploadDialog = false" />
140141
<v-btn color="blue-darken-1" variant="text" @click="uploadPGN">
141142
Save
142143
</v-btn>
143144
</v-card-actions>
144145
</v-card>
145146
</v-dialog>
146-
<v-btn v-if="useSupabaseUser() && saveToProfileStatus === 'pending'" color="blue" @click.prevent="saveToProfile">
147+
<v-btn v-if="useSupabaseUser() && saveToProfileStatus === 'pending'" color="blue" :disabled="history.flat().length == 0"
148+
@click.prevent="saveToProfile">
147149
Save to Profile
148150
</v-btn>
149151
<v-btn v-else-if="saveToProfileStatus === 'sending'" color="grey" :disabled="true">
@@ -350,11 +352,13 @@ export default defineComponent({
350352
}
351353
},
352354
353-
handleReset() {
355+
handleReset(isActive: Ref<boolean>) {
354356
this.boardAPI?.resetBoard()
355357
this.status = 'Pending'
356358
this.saveToProfileStatus = 'pending'
357359
this.history = [[]]
360+
this.whiteOnBottom = true
361+
isActive.value = false
358362
},
359363
360364
/**

0 commit comments

Comments
 (0)