fix: Add postAuthenticate hook for source control preferences (no-changelog) (#6629)

* feat: handle source control settings in post-authenticate app hook

* fix: only trigger post authenticate when logging in

* chore: remove console.log

* chore: fix linting issues

* test: update source control test
This commit is contained in:
Alex Grozav
2023-07-10 12:35:36 +02:00
committed by GitHub
parent 9460bdd3be
commit a95862b6e2
4 changed files with 44 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, reactive, onBeforeMount, ref } from 'vue';
import { computed, reactive, ref, onMounted } from 'vue';
import type { Rule, RuleGroup } from 'n8n-design-system/types';
import { MODAL_CONFIRM, VALID_EMAIL_REGEX } from '@/constants';
import { useUIStore, useSourceControlStore } from '@/stores';
@@ -101,11 +101,16 @@ const goToUpgrade = () => {
uiStore.goToUpgrade('source-control', 'upgrade-source-control');
};
onBeforeMount(() => {
const initialize = async () => {
await sourceControlStore.getPreferences();
if (sourceControlStore.preferences.connected) {
isConnected.value = true;
void sourceControlStore.getBranches();
}
};
onMounted(async () => {
await initialize();
});
const formValidationStatus = reactive<Record<string, boolean>>({