Skip to content

Commit

Permalink
Fix last selected repository if the repo is removed from board
Browse files Browse the repository at this point in the history
  • Loading branch information
blackchestnut committed Sep 12, 2021
1 parent 18b3e04 commit b2f22e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/board/issue_new.vue
Expand Up @@ -197,7 +197,13 @@ export default {
}
},
async created() {
this.selectedRepositoryId = CookieStore.get(NAMESPACE, this.boardId, this.repositories[0].id);
const lastSelectedRepositoryId = CookieStore.get(NAMESPACE, this.boardId, this.repositories[0].id);
if (this.repositories.find(v => v.id === lastSelectedRepositoryId) == null) {
this.selectedRepositoryId = this.repositories[0].id;
CookieStore.set(NAMESPACE, this.boardId, this.selectedRepositoryId);
} else {
this.selectedRepositoryId = lastSelectedRepositoryId;
}
this.selectedColumnId = this.columnId;
this.selectedPosition = this.positions[0];
await this.initAssignableUsers();
Expand Down

0 comments on commit b2f22e9

Please sign in to comment.