2024-05-23 09:42:14 +00:00
|
|
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-04-08 17:02:56 +00:00
|
|
|
import { __ } from 'i18n'
|
|
|
|
import BaseModal from 'plugins/modal/modal.js'
|
|
|
|
import { api } from '@converse/headless/core'
|
|
|
|
import { html } from 'lit'
|
|
|
|
import 'livechat-external-login-content.js'
|
|
|
|
|
|
|
|
class ExternalLoginModal extends BaseModal {
|
|
|
|
remotePeertubeError = ''
|
|
|
|
|
|
|
|
renderModal () {
|
|
|
|
return html`<converse-livechat-external-login-content></converse-livechat-external-login-content>`
|
|
|
|
}
|
|
|
|
|
|
|
|
getModalTitle () {
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
return __(LOC_login_using_external_account)
|
|
|
|
}
|
2024-04-17 10:09:25 +00:00
|
|
|
|
|
|
|
onHide () {
|
|
|
|
super.onHide()
|
2024-04-19 07:53:23 +00:00
|
|
|
// kill the externalAuthGetResult handler if still there
|
2024-04-17 10:09:25 +00:00
|
|
|
try {
|
2024-04-19 07:53:23 +00:00
|
|
|
if (window.externalAuthGetResult) { window.externalAuthGetResult() }
|
2024-04-17 10:09:25 +00:00
|
|
|
} catch (err) {
|
|
|
|
console.error(err)
|
|
|
|
}
|
|
|
|
}
|
2024-04-08 17:02:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
api.elements.define('converse-livechat-external-login', ExternalLoginModal)
|