@@ -164,14 +164,14 @@ export default {
164164 }
165165
166166 switch (error .reason ) {
167- case InvalidFilenameErrorReason .Character :
168- return t (' files' , ' "{char}" is not allowed inside a filename.' , { char: error .segment })
169- case InvalidFilenameErrorReason .ReservedName :
170- return undefined // We don't need to enforce that for albums.
171- case InvalidFilenameErrorReason .Extension :
172- return undefined // We don't need to enforce that for albums.
173- default :
174- return t (' files' , ' Invalid filename.' )
167+ case InvalidFilenameErrorReason .Character :
168+ return t (' files' , ' "{char}" is not allowed inside a filename.' , { char: error .segment })
169+ case InvalidFilenameErrorReason .ReservedName :
170+ return undefined // We don't need to enforce that for albums.
171+ case InvalidFilenameErrorReason .Extension :
172+ return undefined // We don't need to enforce that for albums.
173+ default :
174+ return t (' files' , ' Invalid filename.' )
175175 }
176176 }
177177
@@ -256,6 +256,10 @@ export default {
256256
257257 if (this .album .basename !== this .albumName ) {
258258 album = await this .renameCollection ({ collectionFileName: this .album .filename , newBaseName: this .albumName })
259+
260+ if (album === this .album ) {
261+ return // Abort, and do not close the form if renaming failed
262+ }
259263 }
260264
261265 if (this .album .location !== this .albumLocation ) {
@@ -303,7 +307,8 @@ export default {
303307 justify- content: space- between;
304308 flex- direction: column;
305309
306- .left - buttons, .right - buttons {
310+ .left - buttons,
311+ .right - buttons {
307312 display: flex;
308313 gap: calc (var (-- default- grid- baseline) * 4 );
309314 }
0 commit comments