зеркало из https://github.com/nextcloud/spreed.git
Show message when trying to leave as last moderator
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
1e5ac86457
Коммит
8bae5eb250
|
@ -217,7 +217,11 @@ export default {
|
||||||
// If successful, deletes the conversation from the store
|
// If successful, deletes the conversation from the store
|
||||||
this.$store.dispatch('deleteConversation', this.item)
|
this.$store.dispatch('deleteConversation', this.item)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.debug(`error while removing yourself from conversation ${error}`)
|
if (error.response.status === 400) {
|
||||||
|
OCP.Toast.error(t('spreed', 'You need to promote a new moderator before you can leave the conversation.'))
|
||||||
|
} else {
|
||||||
|
console.debug(`error while removing yourself from conversation ${error}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async toggleFavoriteConversation() {
|
async toggleFavoriteConversation() {
|
||||||
|
|
|
@ -72,12 +72,8 @@ const addParticipant = async function(token, newParticipant, source) {
|
||||||
* @param {string} token The conversation token;
|
* @param {string} token The conversation token;
|
||||||
*/
|
*/
|
||||||
const removeCurrentUserFromConversation = async function(token) {
|
const removeCurrentUserFromConversation = async function(token) {
|
||||||
try {
|
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v1', 2) + `room/${token}/participants/self`)
|
||||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v1', 2) + `room/${token}/participants/self`)
|
return response
|
||||||
return response
|
|
||||||
} catch (error) {
|
|
||||||
console.debug(error)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const removeUserFromConversation = async function(token, userId) {
|
const removeUserFromConversation = async function(token, userId) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче