Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0910af77 authored by Ronak Patel's avatar Ronak Patel
Browse files

open onlyoffice in same tab

parent cf208aba
Loading
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -109,7 +109,6 @@ export default {
		handleOfficeClick(entry, e) {
		handleOfficeClick(entry, e) {
			if (entry.type === 'onlyoffice') {
			if (entry.type === 'onlyoffice') {
				e.preventDefault()
				e.preventDefault()
				const newWindow = window.open('about:blank', '_blank')
				axios.get('/apps/murena_launcher/getDocumentsFolder').then(function(response) {
				axios.get('/apps/murena_launcher/getDocumentsFolder').then(function(response) {
					const dir = response.data.dir
					const dir = response.data.dir
					if (dir && dir.length) {
					if (dir && dir.length) {
@@ -130,14 +129,12 @@ export default {
							})
							})
							.then(function(response) {
							.then(function(response) {
								if (response.data.id) {
								if (response.data.id) {
									newWindow.location.href = '/apps/onlyoffice/' + response.data.id
									window.open('/apps/onlyoffice/' + response.data.id, '_self')
								} else if (response.data.error && response.data.error.length) {
								} else if (response.data.error && response.data.error.length) {
									showError(response.data.error)
									showError(response.data.error)
									newWindow.close()
								}
								}
							}).catch(function() {
							}).catch(function() {
								showError(entry.t('murena_launcher', 'Error when trying to connect to ONLYOFFICE'))
								showError(entry.t('murena_launcher', 'Error when trying to connect to ONLYOFFICE'))
								newWindow.close()
							})
							})
					}
					}
				}).catch(function(error) {
				}).catch(function(error) {
@@ -145,7 +142,6 @@ export default {
						const errorMessage = error.response.data.error
						const errorMessage = error.response.data.error
						showError(errorMessage)
						showError(errorMessage)
					}
					}
					newWindow.close()
				})
				})


			}
			}