Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB-1216: Add warning on sharing when there is a local files. #1136

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
13 changes: 10 additions & 3 deletions src/modules/menu/components/share/MenuShareSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
</template>

<script>
import { mapActions, mapState } from 'vuex'
import { mapActions, mapGetters, mapState } from 'vuex'

import MenuSection from '@/modules/menu/components/menu/MenuSection.vue'
import MenuShareEmbed from '@/modules/menu/components/share/MenuShareEmbed.vue'
import MenuShareInputCopyButton from '@/modules/menu/components/share/MenuShareInputCopyButton.vue'
import MenuShareSocialNetworks from '@/modules/menu/components/share/MenuShareSocialNetworks.vue'
import WarningMessage from '@/utils/WarningMessage.class'

const dispatcher = { dispatcher: 'MenuShareSection.vue' }

Expand Down Expand Up @@ -59,17 +60,23 @@ export default {
isTrackingGeolocation: (state) =>
state.geolocation.active && state.geolocation.tracking,
}),
...mapGetters(['hasAnyLocalFile']),
},
methods: {
...mapActions([
'generateShortLinks',
'addWarnings',
'clearShortLinks',
'toggleShareMenuSection',
'closeShareMenuAndRemoveShortLinks',
'generateShortLinks',
'toggleShareMenuSection',
]),
toggleShareMenu() {
this.toggleShareMenuSection(dispatcher)
if (!this.shortLink) {
if (this.hasAnyLocalFile()) {
const warnings = [new WarningMessage('warn_share_local_file')]
this.addWarnings({ warnings, ...dispatcher })
}
this.generateShortLinks({
withCrosshair: this.isTrackingGeolocation,
...dispatcher,
Expand Down
Loading