Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions frontend/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
</template>

<script setup lang="ts">
import AddSourceImap from '@/components/mining/stepper-panels/source/AddSourceImap.vue';
import PassiveMiningDialog from '@/components/mining/PassiveMiningDialog.vue';
import AddSourceImap from '@/components/mining/stepper-panels/source/AddSourceImap.vue';
import type { MiningSource } from '@/types/mining';
import {
asToastHasLinksGroupDetail,
Expand All @@ -109,6 +109,7 @@ import { signOutManually } from './utils/auth';
const $user = useSupabaseUser();
const $leadminerStore = useLeadminerStore();
const $imapDialogStore = useImapDialog();
const $stepper = useMiningStepper();
const activeTask = computed(() => $leadminerStore.activeTask);
const imapReconnectSource = ref<MiningSource>();
const $supabaseClient = useSupabaseClient();
Expand All @@ -130,8 +131,12 @@ watch(idle, (isIdle) => {
});

Normalizer.setLang($leadminerStore.language || 'en');

watch(activeTask, () => {
reset();
});

if ($user.value) {
await $leadminerStore.fetchMiningSources();
$stepper.index = await $leadminerStore.getCurrentRunningMining();
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const $stepper = useMiningStepper();
const $leadminerStore = useLeadminerStore();
const $imapDialogStore = useImapDialog();
const $sourcePanelStore = useStepperSourcePanel();
const sourceOptions = computed(() => useLeadminerStore().miningSources);
const sourceOptions = computed(() => $leadminerStore.miningSources);
const sourceModel = ref<MiningSource | undefined>();

function extractContacts(miningSource?: MiningSource) {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/mine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const showTable = computed(

onMounted(async () => {
try {
await $leadminer.fetchMiningSources();
const step = await $leadminer.getCurrentRunningMining();
const step = $stepper.index;
if (step !== undefined && step > 1) {
$stepper.go(step);
}
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/sources.vue
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,6 @@ async function reconnectExpiredSource(source: MiningSource) {
onMounted(async () => {
const reconnectEmail = $route.query.reconnect as string;

await $leadminer.fetchMiningSources();
await $leadminer.getCurrentRunningMining();

if (reconnectEmail) {
const source = $leadminer.miningSources.find(
(s) => s.email.toLowerCase() === reconnectEmail.toLowerCase(),
Expand Down
Loading