album: fix route after name edit
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/953/head
parent
75d82bf2d2
commit
5f138698e0
|
@ -66,19 +66,22 @@ export default defineComponent({
|
||||||
this.show = false;
|
this.show = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
done({ album }: { album: { basename: string; filename: string } }) {
|
async done({ album }: { album: { basename: string; filename: string } }) {
|
||||||
|
// close modal first to pop fragments
|
||||||
|
await this.close();
|
||||||
|
|
||||||
|
// navigate to album if name changed
|
||||||
if (!this.album || album.basename !== this.album.basename) {
|
if (!this.album || album.basename !== this.album.basename) {
|
||||||
const user = album.filename.split('/')[2];
|
const user = album.filename.split('/')[2];
|
||||||
const name = album.basename;
|
const name = album.basename;
|
||||||
const route = { name: 'albums', params: { user, name } };
|
const route = { name: 'albums', params: { user, name } };
|
||||||
|
|
||||||
if (!this.album) {
|
if (!this.album) {
|
||||||
this.$router.push(route);
|
await this.$router.push(route);
|
||||||
} else {
|
} else {
|
||||||
this.$router.replace(route);
|
await this.$router.replace(route);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.close();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue