<commit_before>/**
 * @copyright Copyright (c) 2019 <NAME> <<EMAIL>>
 *
 * @author <NAME> <<EMAIL>>
 *
 * @license GNU AGPL version 3 or any later version
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */

import { showError } from '@nextcloud/dialogs'

const browserCheck = {
	methods: {
		checkBrowser() {
			if (!this.isFullySupported) {
				showError(
					this.unsupportedWarning,
					{
						timeout: 0,
					})
			}
		},
	},
	computed: {
		isFullySupported() {
			return (this.$browserDetect.isFirefox && this.$browserDetect.meta.version >= 52)
			|| (this.$browserDetect.isChrome && this.$browserDetect.meta.version >= 49)
		},
		// Disable the call button and show the tooltip
		blockCalls() {
			return (this.$browserDetect.isFirefox && this.$browserDetect.meta.version < 52)
			|| (this.$browserDetect.isChrome && this.$browserDetect.meta.version < 49)
			|| this.$browserDetect.isIE
		},
		// Used both in the toast and in the callbutton tooltip
		unsupportedWarning() {
			return t('spreed', "The browser you're using is not fully supported by Nextcloud Talk. Please use the latest version of Mozilla Firefox, Microsoft Edge, Google Chrome or Apple Safari.")
		},
		// Used in CallButton.vue
		callButtonTooltipText() {
			if (this.blockCalls) {
				return this.unsupportedWarning
			} else {
				// Passind a falsy value into the content of the tooltip
				// is the only way to disable it conditionally.
				return false
			}
		},

	},
}

export default browserCheck<commit_msg>Don't show a warning to use the same browser<commit_after>/**
 * @copyright Copyright (c) 2019 <NAME> <<EMAIL>>
 *
 * @author <NAME> <<EMAIL>>
 *
 * @license GNU AGPL version 3 or any later version
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */

import { showError } from '@nextcloud/dialogs'

const browserCheck = {
	methods: {
		checkBrowser() {
			if (!this.isFullySupported) {
				showError(
					this.unsupportedWarning,
					{
						timeout: 0,
					})
			}
		},
	},
	computed: {
		isFullySupported() {
			return (this.$browserDetect.isFirefox && this.$browserDetect.meta.version >= 52)
			|| (this.$browserDetect.isChrome && this.$browserDetect.meta.version >= 49)
			|| (this.$browserDetect.isSafari && this.$browserDetect.meta.version >= 12)
			|| this.$browserDetect.isEdge
		},
		// Disable the call button and show the tooltip
		blockCalls() {
			return (this.$browserDetect.isFirefox && this.$browserDetect.meta.version < 52)
			|| (this.$browserDetect.isChrome && this.$browserDetect.meta.version < 49)
			|| (this.$browserDetect.isSafari && this.$browserDetect.meta.version < 12)
			|| this.$browserDetect.isIE
		},
		// Used both in the toast and in the call button tooltip
		unsupportedWarning() {
			return t('spreed', "The browser you're using is not fully supported by Nextcloud Talk. Please use the latest version of Mozilla Firefox, Microsoft Edge, Google Chrome or Apple Safari.")
		},
		// Used in CallButton.vue
		callButtonTooltipText() {
			if (this.blockCalls) {
				return this.unsupportedWarning
			} else {
				// Passing a falsy value into the content of the tooltip
				// is the only way to disable it conditionally.
				return false
			}
		},

	},
}

export default browserCheck
{'fraction_non_alphanumeric': 0.10381165919282512, 'fraction_numerical': 0.007623318385650224, 'mean_word_length': 3.4654654654654653, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3681810', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1259, 'n_words': 479}