<commit_before><template>

  <SelectAddressModalGroup
    :fetchAddressArgs="fetchAddressArgs"
    @cancel="handleCancel"
    @submit="handleSelectAddressSubmit"
  />

</template>


<script>

  import { mapGetters, mapMutations, mapState } from 'vuex';
  import { SelectAddressModalGroup } from 'kolibri.coreVue.componentSets.sync';
  import { availableChannelsPageLink, selectContentPageLink } from '../manageContentLinks';

  export default {
    name: 'SelectNetworkAddressModal',
    components: {
      SelectAddressModalGroup,
    },
    props: {
      manageMode: {
        type: Boolean,
        required: false,
      },
    },
    data() {
      return {};
    },
    computed: {
      ...mapGetters('manageContent/wizard', ['isImportingMore']),
      ...mapState('manageContent/wizard', ['transferredChannel']),
      fetchAddressArgs() {
        return this.isImportingMore ? this.transferredChannel.id : '';
      },
    },
    methods: {
      ...mapMutations('manageContent/wizard', {
        resetContentWizardState: 'RESET_STATE',
      }),
      handleSelectAddressSubmit(addressId) {
        if (this.manageMode) {
          this.$emit('submit', { addressId });
        } else {
          if (this.isImportingMore) {
            this.$router.push(
              selectContentPageLink({
                addressId,
                channelId: this.transferredChannel.id,
              })
            );
          } else {
            this.$router.push(availableChannelsPageLink({ addressId }));
          }
        }
      },
      handleCancel() {
        if (this.manageMode) {
          this.$emit('cancel');
        } else {
          this.resetContentWizardState();
        }
      },
    },
  };

</script>

<commit_msg>Fix AvailableChannels URL when picking a local peer<commit_after><template>

  <SelectAddressModalGroup
    :fetchAddressArgs="fetchAddressArgs"
    @cancel="handleCancel"
    @submit="handleSelectAddressSubmit"
  />

</template>


<script>

  import { mapGetters, mapMutations, mapState } from 'vuex';
  import { SelectAddressModalGroup } from 'kolibri.coreVue.componentSets.sync';
  import { availableChannelsPageLink, selectContentPageLink } from '../manageContentLinks';

  export default {
    name: 'SelectNetworkAddressModal',
    components: {
      SelectAddressModalGroup,
    },
    props: {
      manageMode: {
        type: Boolean,
        required: false,
      },
    },
    data() {
      return {};
    },
    computed: {
      ...mapGetters('manageContent/wizard', ['isImportingMore']),
      ...mapState('manageContent/wizard', ['transferredChannel']),
      fetchAddressArgs() {
        return this.isImportingMore ? this.transferredChannel.id : '';
      },
    },
    methods: {
      ...mapMutations('manageContent/wizard', {
        resetContentWizardState: 'RESET_STATE',
      }),
      handleSelectAddressSubmit(address) {
        const addressId = address.id;
        if (this.manageMode) {
          this.$emit('submit', { addressId });
        } else {
          if (this.isImportingMore) {
            this.$router.push(
              selectContentPageLink({
                addressId,
                channelId: this.transferredChannel.id,
              })
            );
          } else {
            this.$router.push(availableChannelsPageLink({ addressId }));
          }
        }
      },
      handleCancel() {
        if (this.manageMode) {
          this.$emit('cancel');
        } else {
          this.resetContentWizardState();
        }
      },
    },
  };

</script>


{'fraction_non_alphanumeric': 0.12788083192804947, 'fraction_numerical': 0.0, 'mean_word_length': 2.1412180052956753, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3961693', 'n_tokens_mistral': 1009, 'n_tokens_neox': 989, 'n_words': 154}