-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: share management delete confirm (#1212)
- Loading branch information
Showing
5 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<div class="card floating"> | ||
<div class="card-content"> | ||
<p>{{ $t('prompts.deleteMessageShare', {path: hash.path}) }}</p> | ||
</div> | ||
<div class="card-action"> | ||
<button @click="$store.commit('closeHovers')" | ||
class="button button--flat button--grey" | ||
:aria-label="$t('buttons.cancel')" | ||
:title="$t('buttons.cancel')">{{ $t('buttons.cancel') }}</button> | ||
<button @click="submit" | ||
class="button button--flat button--red" | ||
:aria-label="$t('buttons.delete')" | ||
:title="$t('buttons.delete')">{{ $t('buttons.delete') }}</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import {mapMutations, mapState} from 'vuex' | ||
import { share as api } from '@/api' | ||
import buttons from '@/utils/buttons' | ||
export default { | ||
name: 'share-delete', | ||
computed: { | ||
...mapState(['hash']) | ||
}, | ||
methods: { | ||
...mapMutations(['closeHovers']), | ||
submit: async function () { | ||
buttons.loading('delete') | ||
try { | ||
await api.remove(this.hash.hash) | ||
buttons.success('delete') | ||
this.$root.$emit('share-deleted', this.hash.hash) | ||
this.closeHovers() | ||
} catch (e) { | ||
buttons.done('delete') | ||
this.$showError(e) | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters